]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPObjClass.h
4a383d6dfd865537a297847e668e8899acd1ec17
[openldap] / contrib / ldapc++ / src / LDAPObjClass.h
1 /*
2  * Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6 #ifndef LDAP_OBJCLASS_H
7 #define LDAP_OBJCLASS_H
8
9 #include <ldap_schema.h>
10 #include <string>
11
12 #include "StringList.h"
13
14 #define SCHEMA_PARSE_FLAG    0x03
15
16
17 using namespace std;
18
19 /**
20  * Represents the Object Class (from LDAP schema)
21  */
22 class LDAPObjClass{
23     private :
24         StringList names, must, may, sup;
25         string desc, oid;
26         int kind;
27         
28     public :
29
30         /**
31          * Constructs an empty object.
32          */   
33         LDAPObjClass();
34
35         /**
36          * Copy constructor
37          */   
38         LDAPObjClass (const LDAPObjClass& oc);
39
40         /**
41          * Constructs new object and fills the data structure by parsing the
42          * argument.
43          * @param oc_item description of object class is string returned
44          * by the search command. It is in the form:
45          * "( SuSE.YaST.OC:5 NAME 'userTemplate' SUP objectTemplate STRUCTURAL
46          *    DESC 'User object template' MUST ( cn ) MAY ( secondaryGroup ))"
47          */   
48         LDAPObjClass (string oc_item);
49
50         /**
51          * Destructor
52          */
53         virtual ~LDAPObjClass();
54         
55         /**
56          * Returns object class description
57          */
58         string getDesc ();
59         
60         /**
61          * Returns object class oid
62          */
63         string getOid ();
64
65         /**
66          * Returns object class name (first one if there are more of them)
67          */
68         string getName ();
69
70         /**
71          * Returns all object class names
72          */
73         StringList getNames();
74         
75         /**
76          * Returns list of required attributes
77          */
78         StringList getMust();
79         
80         /**
81          * Returns list of allowed (and not required) attributes
82          */
83         StringList getMay();
84         
85         /**
86          * Returns list of the OIDs of the superior ObjectClasses
87          */
88         StringList getSup();
89
90         void setNames (char **oc_names);
91         void setMay (char **oc_may);
92         void setMust (char **oc_must);
93         void setDesc (char *oc_desc);
94         void setOid (char *oc_oid);
95         void setKind (int oc_kind);
96         void setSup (char **oc_sup);
97         
98 };
99
100 #endif // LDAP_OBJCLASS_H