- removed unneeded copy constructor

- handle more AttributeType properties
- additional "const"-ification
This commit is contained in:
Ralf Haferkamp 2008-04-30 17:43:32 +00:00
parent c9f7beb86a
commit 318a680879
2 changed files with 74 additions and 27 deletions

View File

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

View File

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