From: Quanah Gibson-Mount Date: Wed, 3 Sep 2008 01:58:15 +0000 (+0000) Subject: Allow to pass LDAP_SCHEMA_-flags X-Git-Tag: OPENLDAP_REL_ENG_2_4_12~101 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6578cfd073eea1aecb0dbb70ab8e352d024be508;p=openldap Allow to pass LDAP_SCHEMA_-flags --- diff --git a/contrib/ldapc++/src/LDAPAttrType.cpp b/contrib/ldapc++/src/LDAPAttrType.cpp index 39898cd3e3..d7650002a4 100644 --- a/contrib/ldapc++/src/LDAPAttrType.cpp +++ b/contrib/ldapc++/src/LDAPAttrType.cpp @@ -19,7 +19,7 @@ LDAPAttrType::LDAPAttrType(){ usage = 0; } -LDAPAttrType::LDAPAttrType (string at_item) { +LDAPAttrType::LDAPAttrType (string at_item, int flags ) { DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPAttrType::LDAPAttrType( )" << endl); @@ -27,7 +27,7 @@ LDAPAttrType::LDAPAttrType (string at_item) { LDAPAttributeType *a; int ret; const char *errp; - a = ldap_str2attributetype (at_item.c_str(), &ret, &errp,SCHEMA_PARSE_FLAG); + a = ldap_str2attributetype (at_item.c_str(), &ret, &errp, flags); if (a) { this->setNames( a->at_names ); diff --git a/contrib/ldapc++/src/LDAPAttrType.h b/contrib/ldapc++/src/LDAPAttrType.h index 1069f27fdb..8af09f9d15 100644 --- a/contrib/ldapc++/src/LDAPAttrType.h +++ b/contrib/ldapc++/src/LDAPAttrType.h @@ -12,9 +12,6 @@ #include "StringList.h" -#define SCHEMA_PARSE_FLAG 0x03 - - using namespace std; /** @@ -43,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 diff --git a/contrib/ldapc++/src/LDAPObjClass.cpp b/contrib/ldapc++/src/LDAPObjClass.cpp index b7621afe07..978e7ec4c4 100644 --- a/contrib/ldapc++/src/LDAPObjClass.cpp +++ b/contrib/ldapc++/src/LDAPObjClass.cpp @@ -33,7 +33,7 @@ LDAPObjClass::LDAPObjClass (const LDAPObjClass &oc){ sup = oc.sup; } -LDAPObjClass::LDAPObjClass (string oc_item) { +LDAPObjClass::LDAPObjClass (string oc_item, int flags ) { DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPObjClass::LDAPObjClass( )" << endl); @@ -41,7 +41,7 @@ LDAPObjClass::LDAPObjClass (string oc_item) { LDAPObjectClass *o; int ret; const char *errp; - o = ldap_str2objectclass ( oc_item.c_str(), &ret, &errp, SCHEMA_PARSE_FLAG); + o = ldap_str2objectclass ( oc_item.c_str(), &ret, &errp, flags ); if (o) { this->setNames (o->oc_names); diff --git a/contrib/ldapc++/src/LDAPObjClass.h b/contrib/ldapc++/src/LDAPObjClass.h index 87f87f1dc3..b4221eb788 100644 --- a/contrib/ldapc++/src/LDAPObjClass.h +++ b/contrib/ldapc++/src/LDAPObjClass.h @@ -12,9 +12,6 @@ #include "StringList.h" -#define SCHEMA_PARSE_FLAG 0x03 - - using namespace std; /** @@ -36,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 @@ -46,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