ldapsdk 0.0.1
|
00001 // $OpenLDAP$ 00002 /* 00003 * Copyright 2000-2002, OpenLDAP Foundation, All Rights Reserved. 00004 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file 00005 */ 00006 00007 00008 #ifndef LDAP_ATTRIBUTE_H 00009 #define LDAP_ATTRIBUTE_H 00010 00011 #include<iostream> 00012 #include<string> 00013 #include<ldap.h> 00014 #include<lber.h> 00015 00016 #include <StringList.h> 00017 00021 class LDAPAttribute{ 00022 public : 00027 LDAPAttribute(); 00028 00034 LDAPAttribute(const LDAPAttribute& attr); 00035 00043 LDAPAttribute(const std::string& name, const std::string& value=""); 00044 00051 LDAPAttribute(const char* name, char **values); 00052 00060 LDAPAttribute(const std::string& name, const StringList& values); 00061 00072 LDAPAttribute(const char* name, BerValue **values); 00073 00077 ~LDAPAttribute(); 00078 00084 void addValue(const std::string& value); 00085 00093 int addValue(const BerValue *value); 00094 00104 int setValues(char** values); 00105 00115 int setValues(BerValue** values); 00116 00124 void setValues(const StringList& values); 00125 00135 BerValue** getBerValues() const; 00136 00140 const StringList& getValues() const; 00141 00145 int getNumValues() const; 00146 00150 const std::string& getName() const ; 00151 00156 void setName(const std::string& name); 00157 00164 LDAPMod* toLDAPMod() const ; 00165 00169 bool isNotPrintable() const ; 00170 00171 private : 00172 std::string m_name; 00173 StringList m_values; 00174 00179 friend std::ostream& operator << (std::ostream& s, const LDAPAttribute& attr); 00180 }; 00181 #endif //#ifndef LDAP_ATTRIBUTE_H