2 * Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #include "LDAPObjClass.h"
10 LDAPObjClass::LDAPObjClass(){
11 DEBUG(LDAP_DEBUG_CONSTRUCT,
12 "LDAPObjClass::LDAPObjClass( )" << endl);
16 names = StringList ();
22 LDAPObjClass::LDAPObjClass (const LDAPObjClass &oc){
23 DEBUG(LDAP_DEBUG_CONSTRUCT,
24 "LDAPObjClass::LDAPObjClass( )" << endl);
35 LDAPObjClass::LDAPObjClass (string oc_item) {
37 DEBUG(LDAP_DEBUG_CONSTRUCT,
38 "LDAPObjClass::LDAPObjClass( )" << endl);
43 o = ldap_str2objectclass ( oc_item.c_str(), &ret, &errp, SCHEMA_PARSE_FLAG);
46 this->setNames (o->oc_names);
47 this->setDesc (o->oc_desc);
48 this->setOid (o->oc_oid);
49 this->setKind (o->oc_kind);
50 this->setMust (o->oc_at_oids_must);
51 this->setMay (o->oc_at_oids_may);
52 this->setSup (o->oc_sup_oids);
57 LDAPObjClass::~LDAPObjClass() {
58 DEBUG(LDAP_DEBUG_DESTROY,"LDAPObjClass::~LDAPObjClass()" << endl);
61 void LDAPObjClass::setKind (int oc_kind) {
65 void LDAPObjClass::setNames (char **oc_names) {
66 names = StringList (oc_names);
69 void LDAPObjClass::setMust (char **oc_must) {
70 must = StringList (oc_must);
73 void LDAPObjClass::setMay (char **oc_may) {
74 may = StringList (oc_may);
77 void LDAPObjClass::setSup (char **oc_sup) {
78 sup = StringList (oc_sup);
81 void LDAPObjClass::setDesc (char *oc_desc) {
87 void LDAPObjClass::setOid (char *oc_oid) {
93 string LDAPObjClass::getOid () {
97 string LDAPObjClass::getDesc () {
101 StringList LDAPObjClass::getNames () {
105 StringList LDAPObjClass::getMust () {
109 StringList LDAPObjClass::getMay () {
113 StringList LDAPObjClass::getSup () {
117 string LDAPObjClass::getName () {
122 return *(names.begin());