]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPObjClass.h
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
[openldap] / contrib / ldapc++ / src / LDAPObjClass.h
index 13cdea1f620bbeb5b2febcbd2a95f837688e8403..da330dc2318f02e364395f11a205a131685e7a6c 100644 (file)
@@ -1,5 +1,6 @@
+// $OpenLDAP$
 /*
- * Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2003-2014 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -11,9 +12,6 @@
 
 #include "StringList.h"
 
-#define SCHEMA_PARSE_FLAG    0x03
-
-
 using namespace std;
 
 /**
@@ -21,7 +19,7 @@ using namespace std;
  */
 class LDAPObjClass{
     private :
-       StringList names, must, may;
+       StringList names, must, may, sup;
        string desc, oid;
        int kind;
        
@@ -35,7 +33,7 @@ class LDAPObjClass{
         /**
          * Copy constructor
         */   
-       LDAPObjClass (const LDAPObjClass& oc);
+       LDAPObjClass( const LDAPObjClass& oc );
 
         /**
         * Constructs new object and fills the data structure by parsing the
@@ -45,7 +43,8 @@ class LDAPObjClass{
         * "( SuSE.YaST.OC:5 NAME 'userTemplate' SUP objectTemplate STRUCTURAL
         *    DESC 'User object template' MUST ( cn ) MAY ( secondaryGroup ))"
          */   
-        LDAPObjClass (string oc_item);
+        LDAPObjClass (string oc_item, int flags = LDAP_SCHEMA_ALLOW_NO_OID |
+                      LDAP_SCHEMA_ALLOW_QUOTED);
 
         /**
          * Destructor
@@ -55,32 +54,42 @@ class LDAPObjClass{
        /**
         * Returns object class description
         */
-       string getDesc ();
+       string getDesc() const;
        
        /**
         * Returns object class oid
         */
-       string getOid ();
+       string getOid() const;
 
        /**
         * Returns object class name (first one if there are more of them)
         */
-       string getName ();
+       string getName() const;
+
+       /**
+        * Returns object class kind: 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY
+        */
+       int getKind() const;
 
        /**
         * Returns all object class names
         */
-       StringList getNames();
+       StringList getNames() const;
        
        /**
         * Returns list of required attributes
         */
-       StringList getMust();
+       StringList getMust() const;
        
        /**
         * Returns list of allowed (and not required) attributes
         */
-       StringList getMay();
+       StringList getMay() const;
+       
+        /**
+        * Returns list of the OIDs of the superior ObjectClasses
+        */
+       StringList getSup() const;
 
        void setNames (char **oc_names);
        void setMay (char **oc_may);
@@ -88,6 +97,7 @@ class LDAPObjClass{
        void setDesc (char *oc_desc);
        void setOid (char *oc_oid);
        void setKind (int oc_kind);
+       void setSup (char **oc_sup);
        
 };