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,
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
}
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;
usage = at_usage;
}
-bool LDAPAttrType::isSingle () {
- return single;
+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;
}
-string LDAPAttrType::getOid () {
+bool LDAPAttrType::isSingle() const {
+ return single;
+}
+
+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 "";
return *(names.begin());
}
-int LDAPAttrType::getUsage () {
+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;
+}
+
+
class LDAPAttrType{
private :
StringList names;
- string desc, oid;
+ std::string desc, oid, superiorOid, equalityOid;
+ std::string orderingOid, substringOid, syntaxOid;
bool single;
int usage;
-
+
public :
/**
*/
LDAPAttrType();
- /**
- * Copy constructor
- */
- LDAPAttrType (const LDAPAttrType& oc);
-
/**
* Constructs new object and fills the data structure by parsing the
* argument.
/**
* 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;
+ 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
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 "";
return *(names.begin());
}
-int LDAPObjClass::getKind () {
+int LDAPObjClass::getKind() const {
return kind;
}
/**
* 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);