2 * Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #include "StringList.h"
8 #include "LDAPSchema.h"
12 LDAPSchema::LDAPSchema(){
13 DEBUG(LDAP_DEBUG_CONSTRUCT,
14 "LDAPSchema::LDAPSchema( )" << endl);
17 LDAPSchema::~LDAPSchema() {
18 DEBUG(LDAP_DEBUG_DESTROY,"LDAPSchema::~LDAPSchema()" << endl);
21 void LDAPSchema::setObjectClasses (const StringList &ocs) {
22 DEBUG(LDAP_DEBUG_TRACE,"LDAPSchema::setObjectClasses()" << endl);
24 // parse the stringlist and save it to global map...
25 StringList::const_iterator i,j;
26 for (i = ocs.begin(); i != ocs.end(); i++) {
27 LDAPObjClass oc ( (*i) );
28 StringList names = oc.getNames();
29 // there could be more names for one object...
30 for (j = names.begin(); j != names.end(); j++) {
31 object_classes [(*j)] = LDAPObjClass (oc);
36 void LDAPSchema::setAttributeTypes (const StringList &ats) {
37 DEBUG(LDAP_DEBUG_TRACE,"LDAPSchema::setAttributeTypes()" << endl);
39 // parse the stringlist and save it to global map...
40 StringList::const_iterator i,j;
41 for (i = ats.begin(); i != ats.end(); i++) {
42 LDAPAttrType at ( (*i) );
43 StringList names = at.getNames();
44 // there could be more names for one object...
45 for (j = names.begin(); j != names.end(); j++) {
46 attr_types [(*j)] = LDAPAttrType (at);
51 LDAPObjClass LDAPSchema::getObjectClassByName (string name) {
53 return object_classes [name];
56 LDAPAttrType LDAPSchema::getAttributeTypeByName (string name) {
58 return attr_types [name];