]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPAttribute.h
Initial check of the LDAP C++ SDK written by Ralf Haferkamp <rhafer@suse.de>
[openldap] / contrib / ldapc++ / src / LDAPAttribute.h
1 /*
2  * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6 // $Id: LDAPAttribute.h,v 1.5 2000/08/31 17:43:48 rhafer Exp $
7
8 #ifndef LDAP_ATTRIBUTE_H
9 #define LDAP_ATTRIBUTE_H
10
11 #include<iostream>
12 #include<list>
13 #include<ldap.h>
14 #include<lber.h> 
15
16 typedef list<BerValue*> ValueList;
17
18 class LDAPAttribute{
19
20         private :
21                 char *m_name;
22                 ValueList m_values;
23
24         public :
25                 //Copy constructor
26                 LDAPAttribute(const LDAPAttribute& attr);
27                 LDAPAttribute(const char* name=0, const char *value=0);
28                 LDAPAttribute(const char* name, char **values);
29                 LDAPAttribute(const char* name, BerValue **values);
30                 ~LDAPAttribute();
31
32                 int addValue(const char *value);
33                 int addValue(const BerValue *value);
34                 int setValues(char** values);
35                 int setValues(BerValue** values);
36                 int setValues(ValueList values);
37                 BerValue** getValues() const;
38                 int getNumValues() const;
39                 char* getName();
40                 int setName(const char *name);
41                 bool isNotPrintable() const ;
42
43                 LDAPMod* toLDAPMod() const ;
44                 
45                 friend ostream& operator << (ostream& s, const LDAPAttribute& attr);
46 };
47 #endif //#ifndef LDAP_ATTRIBUTE_H