From: Ralf Haferkamp Date: Wed, 30 Apr 2008 15:18:28 +0000 (+0000) Subject: Use "const" where appropriate X-Git-Tag: LOCKER_IDS~191 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c9f7beb86a018dbcb8581577bb7377afaf19ae80;p=openldap Use "const" where appropriate --- diff --git a/contrib/ldapc++/src/LDAPAttrType.cpp b/contrib/ldapc++/src/LDAPAttrType.cpp index ccfa390298..ecc9f207ee 100644 --- a/contrib/ldapc++/src/LDAPAttrType.cpp +++ b/contrib/ldapc++/src/LDAPAttrType.cpp @@ -78,23 +78,23 @@ void LDAPAttrType::setUsage (int at_usage) { usage = at_usage; } -bool LDAPAttrType::isSingle () { +bool LDAPAttrType::isSingle() const { return single; -} +} -string LDAPAttrType::getOid () { +string LDAPAttrType::getOid() const { return oid; } -string LDAPAttrType::getDesc () { +string LDAPAttrType::getDesc() const { return desc; } -StringList LDAPAttrType::getNames () { +StringList LDAPAttrType::getNames() const { return names; } -string LDAPAttrType::getName () { +string LDAPAttrType::getName() const { if (names.empty()) return ""; @@ -102,6 +102,6 @@ string LDAPAttrType::getName () { return *(names.begin()); } -int LDAPAttrType::getUsage () { +int LDAPAttrType::getUsage() const { return usage; } diff --git a/contrib/ldapc++/src/LDAPAttrType.h b/contrib/ldapc++/src/LDAPAttrType.h index 445f5f79da..6b2b3b62bf 100644 --- a/contrib/ldapc++/src/LDAPAttrType.h +++ b/contrib/ldapc++/src/LDAPAttrType.h @@ -58,34 +58,34 @@ 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 allows only single value */ - bool isSingle(); + bool isSingle() const; /** * Return the 'usage' value: * (0=userApplications, 1=directoryOperation, 2=distributedOperation, * 3=dSAOperation) */ - int getUsage (); + int getUsage () const; void setNames (char **at_names); void setDesc (char *at_desc); diff --git a/contrib/ldapc++/src/LDAPObjClass.cpp b/contrib/ldapc++/src/LDAPObjClass.cpp index 618f3401e5..b7621afe07 100644 --- a/contrib/ldapc++/src/LDAPObjClass.cpp +++ b/contrib/ldapc++/src/LDAPObjClass.cpp @@ -91,31 +91,31 @@ void LDAPObjClass::setOid (char *oc_oid) { oid = oc_oid; } -string LDAPObjClass::getOid () { +string LDAPObjClass::getOid() const { return oid; } -string LDAPObjClass::getDesc () { +string LDAPObjClass::getDesc() const { return desc; } -StringList LDAPObjClass::getNames () { +StringList LDAPObjClass::getNames() const { return names; } -StringList LDAPObjClass::getMust () { +StringList LDAPObjClass::getMust() const { return must; } -StringList LDAPObjClass::getMay () { +StringList LDAPObjClass::getMay() const { return may; } -StringList LDAPObjClass::getSup () { +StringList LDAPObjClass::getSup() const { return sup; } -string LDAPObjClass::getName () { +string LDAPObjClass::getName() const { if (names.empty()) return ""; @@ -123,7 +123,7 @@ string LDAPObjClass::getName () { return *(names.begin()); } -int LDAPObjClass::getKind () { +int LDAPObjClass::getKind() const { return kind; } diff --git a/contrib/ldapc++/src/LDAPObjClass.h b/contrib/ldapc++/src/LDAPObjClass.h index 02175235dd..87f87f1dc3 100644 --- a/contrib/ldapc++/src/LDAPObjClass.h +++ b/contrib/ldapc++/src/LDAPObjClass.h @@ -56,42 +56,42 @@ class LDAPObjClass{ /** * Returns object class description */ - string getDesc (); + string getDesc() const; /** * Returns object class oid */ - string getOid (); + string getOid() const; /** * Returns object class name (first one if there are more of them) */ - string getName (); + string getName() const; /** * Returns object class kind: 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */ - int getKind (); + int getKind() const; /** * Returns all object class names */ - StringList getNames(); + StringList getNames() const; /** * Returns list of required attributes */ - StringList getMust(); + StringList getMust() const; /** * Returns list of allowed (and not required) attributes */ - StringList getMay(); + StringList getMay() const; /** * Returns list of the OIDs of the superior ObjectClasses */ - StringList getSup(); + StringList getSup() const; void setNames (char **oc_names); void setMay (char **oc_may);