Back to index

openldap  2.4.31
Public Member Functions | Private Attributes
LDAPSchema Class Reference

Represents the LDAP schema. More...

#include <LDAPSchema.h>

Collaboration diagram for LDAPSchema:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LDAPSchema ()
 Constructs an empty object.
virtual ~LDAPSchema ()
 Destructor.
void setObjectClasses (const StringList &oc)
 Fill the object_classes map.
void setAttributeTypes (const StringList &at)
 Fill the attr_types map.
LDAPObjClass getObjectClassByName (std::string name)
 Returns object class object with given name.
LDAPAttrType getAttributeTypeByName (string name)
 Returns attribute type object with given name.

Private Attributes

map< string, LDAPObjClassobject_classes
 map of object classes: index is name, value is LDAPObjClass object
map< string, LDAPAttrTypeattr_types
 map of attribute types: index is name, value is LDAPAttrType object

Detailed Description

Represents the LDAP schema.

Definition at line 19 of file LDAPSchema.h.


Constructor & Destructor Documentation

Constructs an empty object.

Definition at line 18 of file LDAPSchema.cpp.

                      {
    DEBUG(LDAP_DEBUG_CONSTRUCT,
            "LDAPSchema::LDAPSchema( )" << endl);
}
LDAPSchema::~LDAPSchema ( ) [virtual]

Destructor.

Definition at line 23 of file LDAPSchema.cpp.

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

Member Function Documentation

Returns attribute type object with given name.

Definition at line 76 of file LDAPSchema.cpp.

                                                            {
    string lc_name = name;
    string::iterator k;
    for ( k = lc_name.begin(); k != lc_name.end(); k++ ) {
        (*k) = tolower(*k); 
    }

    return attr_types [lc_name];
}

Returns object class object with given name.

Definition at line 67 of file LDAPSchema.cpp.

                                                          {
    string lc_name = name;
    string::iterator k;
    for ( k = lc_name.begin(); k != lc_name.end(); k++ ) {
        (*k) = tolower(*k); 
    }
    return object_classes [lc_name];
}

Here is the caller graph for this function:

Fill the attr_types map.

Parameters:
atdescription of one attribute type (string returned by search command), in form: "( 1.2.3.4.6 NAME ( '<name>' ) DESC '<desc>' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"

Definition at line 47 of file LDAPSchema.cpp.

                                                         {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPSchema::setAttributeTypes()" << endl);
    
    // parse the stringlist and save it to global map...
    StringList::const_iterator i,j;
    for (i = ats.begin(); i != ats.end(); i++) {
       LDAPAttrType at ( (*i) );
       StringList names = at.getNames();
       // there could be more names for one object...
       for (j = names.begin(); j != names.end(); j++) {
            string lc_name = *j;
            string::iterator k;
            for ( k = lc_name.begin(); k != lc_name.end(); k++ ) {
                (*k) = tolower(*k); 
            }
           attr_types [lc_name] = LDAPAttrType (at);
       }
    }
}

Here is the call graph for this function:

Fill the object_classes map.

Parameters:
ocdescription of one objectclass (string returned by search command), in form: "( 1.2.3.4.5 NAME '<name>' SUP <supname> STRUCTURAL DESC '<description>' MUST ( <attrtype> ) MAY ( <attrtype> ))"

Definition at line 27 of file LDAPSchema.cpp.

                                                        {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPSchema::setObjectClasses()" << endl);
    
    // parse the stringlist and save it to global map...
    StringList::const_iterator i,j;
    for (i = ocs.begin(); i != ocs.end(); i++) {
       LDAPObjClass oc ( (*i) );
       StringList names = oc.getNames();
       // there could be more names for one object...
       for (j = names.begin(); j != names.end(); j++) {
            string lc_name = *j;
            string::iterator k;
            for ( k = lc_name.begin(); k != lc_name.end(); k++ ) {
                (*k) = tolower(*k); 
            }
           object_classes [lc_name] = LDAPObjClass (oc);
       }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

map<string, LDAPAttrType> LDAPSchema::attr_types [private]

map of attribute types: index is name, value is LDAPAttrType object

Definition at line 29 of file LDAPSchema.h.

map<string, LDAPObjClass> LDAPSchema::object_classes [private]

map of object classes: index is name, value is LDAPObjClass object

Definition at line 24 of file LDAPSchema.h.


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