desc = string ();
names = StringList ();
single = false;
+ usage = 0;
}
LDAPAttrType::LDAPAttrType (const LDAPAttrType &at){
desc = at.desc;
names = at.names;
single = at.single;
+ usage = at.usage;
}
LDAPAttrType::LDAPAttrType (string at_item) {
a = ldap_str2attributetype (at_item.c_str(), &ret, &errp,SCHEMA_PARSE_FLAG);
if (a) {
- this->setNames (a->at_names);
- this->setDesc (a->at_desc);
- this->setOid (a->at_oid);
- this->setSingle (a->at_single_value);
+ this->setNames( a->at_names );
+ this->setDesc( a->at_desc );
+ this->setOid( a->at_oid );
+ this->setSingle( a->at_single_value );
+ this->setSingle( a->at_usage );
}
// else? -> error
}
oid = at_oid;
}
+void LDAPAttrType::setUsage (int at_usage) {
+ usage = at_usage;
+}
+
bool LDAPAttrType::isSingle () {
return single;
}
else
return *(names.begin());
}
+
+int LDAPAttrType::getUsage () {
+ return usage;
+}
StringList names;
string desc, oid;
bool single;
+ int usage;
public :
StringList getNames();
/**
- * Returns true if attribute type hllows only single value
+ * Returns true if attribute type allows only single value
*/
bool isSingle();
+ /**
+ * Return the 'usage' value:
+ * (0=userApplications, 1=directoryOperation, 2=distributedOperation,
+ * 3=dSAOperation)
+ */
+ int getUsage ();
+
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 );
};
#endif // LDAP_ATTRTYPE_H