From 7741e1eeff5a15f0d87ea4005271e65487815aee Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Tue, 9 Jan 2007 12:24:04 +0000 Subject: [PATCH] add support for usage flag --- contrib/ldapc++/src/LDAPAttrType.cpp | 19 +++++++++++++++---- contrib/ldapc++/src/LDAPAttrType.h | 12 ++++++++++-- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/contrib/ldapc++/src/LDAPAttrType.cpp b/contrib/ldapc++/src/LDAPAttrType.cpp index 121f9b6250..d43cf13435 100644 --- a/contrib/ldapc++/src/LDAPAttrType.cpp +++ b/contrib/ldapc++/src/LDAPAttrType.cpp @@ -15,6 +15,7 @@ LDAPAttrType::LDAPAttrType(){ desc = string (); names = StringList (); single = false; + usage = 0; } LDAPAttrType::LDAPAttrType (const LDAPAttrType &at){ @@ -25,6 +26,7 @@ LDAPAttrType::LDAPAttrType (const LDAPAttrType &at){ desc = at.desc; names = at.names; single = at.single; + usage = at.usage; } LDAPAttrType::LDAPAttrType (string at_item) { @@ -38,10 +40,11 @@ LDAPAttrType::LDAPAttrType (string at_item) { a = ldap_str2attributetype (at_item.c_str(), &ret, &errp,SCHEMA_PARSE_FLAG); if (a) { - this->setNames (a->at_names); - this->setDesc (a->at_desc); - this->setOid (a->at_oid); - this->setSingle (a->at_single_value); + this->setNames( a->at_names ); + this->setDesc( a->at_desc ); + this->setOid( a->at_oid ); + this->setSingle( a->at_single_value ); + this->setSingle( a->at_usage ); } // else? -> error } @@ -70,6 +73,10 @@ void LDAPAttrType::setOid (char *at_oid) { oid = at_oid; } +void LDAPAttrType::setUsage (int at_usage) { + usage = at_usage; +} + bool LDAPAttrType::isSingle () { return single; } @@ -93,3 +100,7 @@ string LDAPAttrType::getName () { else return *(names.begin()); } + +int LDAPAttrType::getUsage () { + return usage; +} diff --git a/contrib/ldapc++/src/LDAPAttrType.h b/contrib/ldapc++/src/LDAPAttrType.h index 3042ab5a33..88f066ed88 100644 --- a/contrib/ldapc++/src/LDAPAttrType.h +++ b/contrib/ldapc++/src/LDAPAttrType.h @@ -24,6 +24,7 @@ class LDAPAttrType{ StringList names; string desc, oid; bool single; + int usage; public : @@ -74,15 +75,22 @@ class LDAPAttrType{ StringList getNames(); /** - * Returns true if attribute type hllows only single value + * Returns true if attribute type allows only single value */ bool isSingle(); + /** + * Return the 'usage' value: + * (0=userApplications, 1=directoryOperation, 2=distributedOperation, + * 3=dSAOperation) + */ + int getUsage (); + void setNames (char **at_names); void setDesc (char *at_desc); void setOid (char *at_oid); void setSingle (int at_single_value); - + void setUsage (int at_usage ); }; #endif // LDAP_ATTRTYPE_H