X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=contrib%2Fldapc%2B%2B%2Fsrc%2FLDAPAttrType.h;h=f7eb0ba8b2cc46b5e35b4e50a24546528dbf428d;hb=4d0d12db27b3b44cc36acc089b0e640320480fe7;hp=cb35f4032d70c23c2cee912e444da6632e9c1b5b;hpb=f32368254d8b7b2aceecd10e3d6b02b2efd4a9cf;p=openldap diff --git a/contrib/ldapc++/src/LDAPAttrType.h b/contrib/ldapc++/src/LDAPAttrType.h index cb35f4032d..f7eb0ba8b2 100644 --- a/contrib/ldapc++/src/LDAPAttrType.h +++ b/contrib/ldapc++/src/LDAPAttrType.h @@ -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, equality, syntax; + 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,45 +52,50 @@ class LDAPAttrType{ /** * Returns attribute description */ - string getDesc (); + string getDesc() const; /** * Returns attribute oid */ - string getOid (); - - /** - * Returns equality matching rule - */ - string getEquality (); - - /** - * Returns attribute syntax definition - */ - string getSyntax (); + 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 allows only single value */ - bool isSingle(); - - void setNames (char **at_names); - void setDesc (char *at_desc); - void setEquality (char *at_equality_oid); - void setSyntax (char *at_syntax_oid); - 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