3 * Copyright 2003-2014 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #ifndef LDAP_OBJCLASS_H
8 #define LDAP_OBJCLASS_H
10 #include <ldap_schema.h>
13 #include "StringList.h"
18 * Represents the Object Class (from LDAP schema)
22 StringList names, must, may, sup;
29 * Constructs an empty object.
36 LDAPObjClass( const LDAPObjClass& oc );
39 * Constructs new object and fills the data structure by parsing the
41 * @param oc_item description of object class is string returned
42 * by the search command. It is in the form:
43 * "( SuSE.YaST.OC:5 NAME 'userTemplate' SUP objectTemplate STRUCTURAL
44 * DESC 'User object template' MUST ( cn ) MAY ( secondaryGroup ))"
46 LDAPObjClass (string oc_item, int flags = LDAP_SCHEMA_ALLOW_NO_OID |
47 LDAP_SCHEMA_ALLOW_QUOTED);
52 virtual ~LDAPObjClass();
55 * Returns object class description
57 string getDesc() const;
60 * Returns object class oid
62 string getOid() const;
65 * Returns object class name (first one if there are more of them)
67 string getName() const;
70 * Returns object class kind: 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY
75 * Returns all object class names
77 StringList getNames() const;
80 * Returns list of required attributes
82 StringList getMust() const;
85 * Returns list of allowed (and not required) attributes
87 StringList getMay() const;
90 * Returns list of the OIDs of the superior ObjectClasses
92 StringList getSup() const;
94 void setNames (char **oc_names);
95 void setMay (char **oc_may);
96 void setMust (char **oc_must);
97 void setDesc (char *oc_desc);
98 void setOid (char *oc_oid);
99 void setKind (int oc_kind);
100 void setSup (char **oc_sup);
104 #endif // LDAP_OBJCLASS_H