From 318a680879bd5e2dc48be32179198036fce0bad1 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 30 Apr 2008 17:43:32 +0000 Subject: [PATCH] - removed unneeded copy constructor - handle more AttributeType properties - additional "const"-ification --- contrib/ldapc++/src/LDAPAttrType.cpp | 71 ++++++++++++++++++++++------ contrib/ldapc++/src/LDAPAttrType.h | 30 +++++++----- 2 files changed, 74 insertions(+), 27 deletions(-) diff --git a/contrib/ldapc++/src/LDAPAttrType.cpp b/contrib/ldapc++/src/LDAPAttrType.cpp index ecc9f207ee..39898cd3e3 100644 --- a/contrib/ldapc++/src/LDAPAttrType.cpp +++ b/contrib/ldapc++/src/LDAPAttrType.cpp @@ -19,17 +19,6 @@ LDAPAttrType::LDAPAttrType(){ usage = 0; } -LDAPAttrType::LDAPAttrType (const LDAPAttrType &at){ - DEBUG(LDAP_DEBUG_CONSTRUCT, - "LDAPAttrType::LDAPAttrType( )" << endl); - - oid = at.oid; - desc = at.desc; - names = at.names; - single = at.single; - usage = at.usage; -} - LDAPAttrType::LDAPAttrType (string at_item) { DEBUG(LDAP_DEBUG_CONSTRUCT, @@ -46,6 +35,11 @@ LDAPAttrType::LDAPAttrType (string at_item) { this->setOid( a->at_oid ); this->setSingle( a->at_single_value ); this->setUsage( a->at_usage ); + this->setSuperiorOid( a->at_sup_oid ); + this->setEqualityOid( a->at_equality_oid ); + this->setOrderingOid( a->at_ordering_oid ); + this->setSubstringOid( a->at_substr_oid ); + this->setSyntaxOid( a->at_syntax_oid ); } // else? -> error } @@ -58,17 +52,17 @@ void LDAPAttrType::setSingle (int at_single) { single = (at_single == 1); } -void LDAPAttrType::setNames (char **at_names) { - names = StringList (at_names); +void LDAPAttrType::setNames ( char **at_names ) { + names = StringList(at_names); } -void LDAPAttrType::setDesc (char *at_desc) { +void LDAPAttrType::setDesc (const char *at_desc) { desc = string (); if (at_desc) desc = at_desc; } -void LDAPAttrType::setOid (char *at_oid) { +void LDAPAttrType::setOid (const char *at_oid) { oid = string (); if (at_oid) oid = at_oid; @@ -78,6 +72,31 @@ void LDAPAttrType::setUsage (int at_usage) { usage = at_usage; } +void LDAPAttrType::setSuperiorOid( const char *oid ){ + if ( oid ) + superiorOid = oid; +} + +void LDAPAttrType::setEqualityOid( const char *oid ){ + if ( oid ) + equalityOid = oid; +} + +void LDAPAttrType::setOrderingOid( const char *oid ){ + if ( oid ) + orderingOid = oid; +} + +void LDAPAttrType::setSubstringOid( const char *oid ){ + if ( oid ) + substringOid = oid; +} + +void LDAPAttrType::setSyntaxOid( const char *oid ){ + if ( oid ) + syntaxOid = oid; +} + bool LDAPAttrType::isSingle() const { return single; } @@ -105,3 +124,25 @@ string LDAPAttrType::getName() const { int LDAPAttrType::getUsage() const { return usage; } + +std::string LDAPAttrType::getSuperiorOid() const { + return superiorOid; +} + +std::string LDAPAttrType::getEqualityOid() const { + return equalityOid; +} + +std::string LDAPAttrType::getOrderingOid() const { + return orderingOid; +} + +std::string LDAPAttrType::getSubstringOid() const { + return substringOid; +} + +std::string LDAPAttrType::getSyntaxOid() const { + return syntaxOid; +} + + diff --git a/contrib/ldapc++/src/LDAPAttrType.h b/contrib/ldapc++/src/LDAPAttrType.h index 6b2b3b62bf..1069f27fdb 100644 --- a/contrib/ldapc++/src/LDAPAttrType.h +++ b/contrib/ldapc++/src/LDAPAttrType.h @@ -23,10 +23,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 : /** @@ -34,11 +35,6 @@ class LDAPAttrType{ */ LDAPAttrType(); - /** - * Copy constructor - */ - LDAPAttrType (const LDAPAttrType& oc); - /** * Constructs new object and fills the data structure by parsing the * argument. @@ -86,12 +82,22 @@ class LDAPAttrType{ * 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 (char *at_desc); - void setOid (char *at_oid); - void setSingle (int at_single_value); - void setUsage (int at_usage ); + 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 -- 2.39.5