ldapsdk  0.0.1
LDAPAttribute.h
Go to the documentation of this file.
1 // $OpenLDAP$
2 /*
3  * Copyright 2000-2013 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6 
7 
8 #ifndef LDAP_ATTRIBUTE_H
9 #define LDAP_ATTRIBUTE_H
10 
11 #include<iostream>
12 #include<string>
13 #include<ldap.h>
14 #include<lber.h>
15 
16 #include <StringList.h>
17 
22  public :
27  LDAPAttribute();
28 
34  LDAPAttribute(const LDAPAttribute& attr);
35 
43  LDAPAttribute(const std::string& name, const std::string& value="");
44 
51  LDAPAttribute(const char* name, char **values);
52 
60  LDAPAttribute(const std::string& name, const StringList& values);
61 
72  LDAPAttribute(const char* name, BerValue **values);
73 
78 
84  void addValue(const std::string& value);
85 
93  int addValue(const BerValue *value);
94 
104  int setValues(char** values);
105 
115  int setValues(BerValue** values);
116 
124  void setValues(const StringList& values);
125 
135  BerValue** getBerValues() const;
136 
140  const StringList& getValues() const;
141 
145  int getNumValues() const;
146 
150  const std::string& getName() const ;
151 
156  void setName(const std::string& name);
157 
164  LDAPMod* toLDAPMod() const ;
165 
169  bool isNotPrintable() const ;
170 
171  private :
172  std::string m_name;
173  StringList m_values;
174 
179  friend std::ostream& operator << (std::ostream& s, const LDAPAttribute& attr);
180 };
181 #endif //#ifndef LDAP_ATTRIBUTE_H
BerValue ** getBerValues() const
For interal use only.
Definition: LDAPAttribute.cpp:125
bool isNotPrintable() const
Definition: LDAPAttribute.cpp:175
const StringList & getValues() const
Definition: LDAPAttribute.cpp:120
const std::string & getName() const
Definition: LDAPAttribute.cpp:151
LDAPMod * toLDAPMod() const
For internal use only.
Definition: LDAPAttribute.cpp:164
Represents the name an value(s) of an Attribute.
Definition: LDAPAttribute.h:21
~LDAPAttribute()
Destructor.
Definition: LDAPAttribute.cpp:73
void addValue(const std::string &value)
Add a single string value(bin/char) to the Attribute.
void setName(const std::string &name)
Sets the Attribute&#39;s name (type)
Definition: LDAPAttribute.cpp:156
int setValues(char **values)
Set the values of the attribute.
Definition: LDAPAttribute.cpp:91
LDAPAttribute()
Default constructor.
Definition: LDAPAttribute.cpp:25
Container class to store multiple string-objects.
Definition: StringList.h:15
friend std::ostream & operator<<(std::ostream &s, const LDAPAttribute &attr)
This method can be used to dump the data of a LDAPResult-Object.
int getNumValues() const
Definition: LDAPAttribute.cpp:146