Back to index

openldap  2.4.31
Public Member Functions | Private Attributes
LDAPObjClass Class Reference

Represents the Object Class (from LDAP schema) More...

#include <LDAPObjClass.h>

Collaboration diagram for LDAPObjClass:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LDAPObjClass ()
 Constructs an empty object.
 LDAPObjClass (const LDAPObjClass &oc)
 Copy constructor.
 LDAPObjClass (string oc_item, int flags=LDAP_SCHEMA_ALLOW_NO_OID|LDAP_SCHEMA_ALLOW_QUOTED)
 Constructs new object and fills the data structure by parsing the argument.
virtual ~LDAPObjClass ()
 Destructor.
string getDesc () const
 Returns object class description.
string getOid () const
 Returns object class oid.
string getName () const
 Returns object class name (first one if there are more of them)
int getKind () const
 Returns object class kind: 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY.
StringList getNames () const
 Returns all object class names.
StringList getMust () const
 Returns list of required attributes.
StringList getMay () const
 Returns list of allowed (and not required) attributes.
StringList getSup () const
 Returns list of the OIDs of the superior ObjectClasses.
void setNames (char **oc_names)
void setMay (char **oc_may)
void setMust (char **oc_must)
void setDesc (char *oc_desc)
void setOid (char *oc_oid)
void setKind (int oc_kind)
void setSup (char **oc_sup)

Private Attributes

StringList names
StringList must
StringList may
StringList sup
string desc
string oid
int kind

Detailed Description

Represents the Object Class (from LDAP schema)

Definition at line 20 of file LDAPObjClass.h.


Constructor & Destructor Documentation

Constructs an empty object.

Definition at line 11 of file LDAPObjClass.cpp.

                          {
    DEBUG(LDAP_DEBUG_CONSTRUCT,
            "LDAPObjClass::LDAPObjClass( )" << endl);

    oid = string ();
    desc = string ();
    names = StringList ();
    must = StringList();
    may = StringList();
    sup = StringList();
}

Copy constructor.

Definition at line 23 of file LDAPObjClass.cpp.

                                                 {
    DEBUG(LDAP_DEBUG_CONSTRUCT,
            "LDAPObjClass::LDAPObjClass( )" << endl);

    oid = oc.oid;
    desc = oc.desc;
    names = oc.names;
    must = oc.must;
    may = oc.may;
    kind = oc.kind;
    sup = oc.sup;
}

Constructs new object and fills the data structure by parsing the argument.

Parameters:
oc_itemdescription of object class is string returned by the search command. It is in the form: "( SuSE.YaST.OC:5 NAME 'userTemplate' SUP objectTemplate STRUCTURAL DESC 'User object template' MUST ( cn ) MAY ( secondaryGroup ))"

Definition at line 36 of file LDAPObjClass.cpp.

                                                      { 

    DEBUG(LDAP_DEBUG_CONSTRUCT,
            "LDAPObjClass::LDAPObjClass( )" << endl);

    LDAPObjectClass *o;
    int ret;
    const char *errp;
    o = ldap_str2objectclass ( oc_item.c_str(), &ret, &errp, flags );

    if (o) {
        this->setNames (o->oc_names);
       this->setDesc (o->oc_desc);
        this->setOid (o->oc_oid);
       this->setKind (o->oc_kind);
        this->setMust (o->oc_at_oids_must);
       this->setMay (o->oc_at_oids_may);
        this->setSup (o->oc_sup_oids);
    }
    // else? -> error
}

Here is the call graph for this function:

Destructor.

Definition at line 58 of file LDAPObjClass.cpp.

                            {
    DEBUG(LDAP_DEBUG_DESTROY,"LDAPObjClass::~LDAPObjClass()" << endl);
}

Member Function Documentation

string LDAPObjClass::getDesc ( ) const

Returns object class description.

Definition at line 98 of file LDAPObjClass.cpp.

                                   {
    return desc;
}

Here is the caller graph for this function:

Returns object class kind: 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY.

Definition at line 126 of file LDAPObjClass.cpp.

                                {
     return kind;
}

Returns list of allowed (and not required) attributes.

Definition at line 110 of file LDAPObjClass.cpp.

                                      {
    return may;
}

Returns list of required attributes.

Definition at line 106 of file LDAPObjClass.cpp.

                                       {
    return must;
}
string LDAPObjClass::getName ( ) const

Returns object class name (first one if there are more of them)

Definition at line 118 of file LDAPObjClass.cpp.

                                   {

    if (names.empty())
       return "";
    else
       return *(names.begin());
}

Here is the call graph for this function:

Returns all object class names.

Definition at line 102 of file LDAPObjClass.cpp.

                                        {
    return names;
}

Here is the caller graph for this function:

string LDAPObjClass::getOid ( ) const

Returns object class oid.

Definition at line 94 of file LDAPObjClass.cpp.

                                  {
    return oid;
}

Returns list of the OIDs of the superior ObjectClasses.

Definition at line 114 of file LDAPObjClass.cpp.

                                      {
    return sup;
}

Here is the caller graph for this function:

void LDAPObjClass::setDesc ( char *  oc_desc)

Definition at line 82 of file LDAPObjClass.cpp.

                                         {
    desc = string ();
    if (oc_desc)
       desc = oc_desc;
}

Here is the caller graph for this function:

Definition at line 62 of file LDAPObjClass.cpp.

                                       {
    kind = oc_kind;
}

Here is the caller graph for this function:

void LDAPObjClass::setMay ( char **  oc_may)

Definition at line 74 of file LDAPObjClass.cpp.

                                        {
    may = StringList (oc_may);
}

Here is the caller graph for this function:

void LDAPObjClass::setMust ( char **  oc_must)

Definition at line 70 of file LDAPObjClass.cpp.

                                          {
    must = StringList (oc_must);
}

Here is the caller graph for this function:

void LDAPObjClass::setNames ( char **  oc_names)

Definition at line 66 of file LDAPObjClass.cpp.

                                            {
    names = StringList (oc_names);
}

Here is the caller graph for this function:

void LDAPObjClass::setOid ( char *  oc_oid)

Definition at line 88 of file LDAPObjClass.cpp.

                                       {
    oid = string ();
    if (oc_oid)
       oid = oc_oid;
}

Here is the caller graph for this function:

void LDAPObjClass::setSup ( char **  oc_sup)

Definition at line 78 of file LDAPObjClass.cpp.

                                        {
    sup = StringList (oc_sup);
}

Here is the caller graph for this function:


Member Data Documentation

string LDAPObjClass::desc [private]

Definition at line 23 of file LDAPObjClass.h.

Definition at line 24 of file LDAPObjClass.h.

Definition at line 22 of file LDAPObjClass.h.

Definition at line 22 of file LDAPObjClass.h.

Definition at line 22 of file LDAPObjClass.h.

string LDAPObjClass::oid [private]

Definition at line 23 of file LDAPObjClass.h.

Definition at line 22 of file LDAPObjClass.h.


The documentation for this class was generated from the following files: