]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPAttrType.h
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / contrib / ldapc++ / src / LDAPAttrType.h
index 3042ab5a3342869b38ae5e0625357ef26193d70f..f7eb0ba8b2cc46b5e35b4e50a24546528dbf428d 100644 (file)
@@ -1,5 +1,6 @@
+// $OpenLDAP$
 /*
- * Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2003-2012 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;
 
 /**
@@ -22,9 +20,11 @@ using namespace std;
 class LDAPAttrType{
     private :
        StringList names;
-       string desc, oid;
+       std::string desc, oid, superiorOid, equalityOid;
+        std::string orderingOid, substringOid, syntaxOid;
        bool single;
-       
+       int usage;
+
     public :
 
         /**
@@ -32,11 +32,6 @@ class LDAPAttrType{
          */   
         LDAPAttrType();
 
-        /**
-         * Copy constructor
-         */   
-       LDAPAttrType (const LDAPAttrType& oc);
-
         /**
         * Constructs new object and fills the data structure by parsing the
         * argument.
@@ -45,7 +40,8 @@ class LDAPAttrType{
         * "( SuSE.YaST.Attr:19 NAME ( 'skelDir' ) DESC ''
         *    EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"
          */   
-        LDAPAttrType (string at_item);
+        LDAPAttrType (string at_item, int flags = LDAP_SCHEMA_ALLOW_NO_OID | 
+                      LDAP_SCHEMA_ALLOW_QUOTED );
 
         /**
          * Destructor
@@ -56,33 +52,50 @@ class LDAPAttrType{
        /**
         * Returns attribute description
         */
-       string getDesc ();
+       string getDesc() const;
        
        /**
         * Returns attribute oid
         */
-       string getOid ();
+       string getOid() const;
 
        /**
         * Returns attribute name (first one if there are more of them)
         */
-       string getName ();
+       string getName() const;
 
        /**
         * Returns all attribute names
         */
-       StringList getNames();
+       StringList getNames() const;
        
        /**
-        * Returns true if attribute type hllows only single value
+        * Returns true if attribute type allows only single value
         */
-       bool isSingle();
-       
-       void setNames (char **at_names);
-       void setDesc (char *at_desc);
-       void setOid (char *at_oid);
-       void setSingle (int at_single_value);
+       bool isSingle() const;
        
+       /**
+        * Return the 'usage' value:
+        * (0=userApplications, 1=directoryOperation, 2=distributedOperation, 
+        *  3=dSAOperation)
+        */
+       int getUsage () const;
+        std::string getSuperiorOid() const;
+        std::string getEqualityOid() const;
+        std::string getOrderingOid() const;
+        std::string getSubstringOid() const;
+        std::string getSyntaxOid() const;
+
+       void setNames( char **at_names);
+       void setDesc(const char *at_desc);
+       void setOid(const char *at_oid);
+       void setSingle(int at_single_value);
+       void setUsage(int at_usage );
+        void setSuperiorOid( const char *oid );
+        void setEqualityOid( const char *oid );
+        void setOrderingOid( const char *oid );
+        void setSubstringOid( const char *oid );
+        void setSyntaxOid( const char *oid );
 };
 
 #endif // LDAP_ATTRTYPE_H