Use "const" where appropriate

This commit is contained in:
Ralf Haferkamp 2008-04-30 15:18:28 +00:00
parent bdd493380d
commit c9f7beb86a
4 changed files with 29 additions and 29 deletions

View file

@ -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;
}

View file

@ -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);

View file

@ -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;
}

View file

@ -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);