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 :
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
Represents the name an value(s) of an Attribute.
Definition: LDAPAttribute.h:21
int getNumValues() const
Definition: LDAPAttribute.cpp:146
bool isNotPrintable() const
Definition: LDAPAttribute.cpp:175
LDAPMod * toLDAPMod() const
For internal use only.
Definition: LDAPAttribute.cpp:164
void addValue(const std::string &value)
Add a single string value(bin/char) to the Attribute.
BerValue ** getBerValues() const
For interal use only.
Definition: LDAPAttribute.cpp:125
void setName(const std::string &name)
Sets the Attribute's name (type)
Definition: LDAPAttribute.cpp:156
const StringList & getValues() const
Definition: LDAPAttribute.cpp:120
friend std::ostream & operator<<(std::ostream &s, const LDAPAttribute &attr)
This method can be used to dump the data of a LDAPResult-Object.
LDAPAttribute(const std::string &name, const StringList &values)
Construct an attribute with multiple string values.
~LDAPAttribute()
Destructor.
Definition: LDAPAttribute.cpp:73
int setValues(char **values)
Set the values of the attribute.
Definition: LDAPAttribute.cpp:91
LDAPAttribute(const std::string &name, const std::string &value="")
Construct an Attribute with a single string value.
LDAPAttribute()
Default constructor.
Definition: LDAPAttribute.cpp:25
const std::string & getName() const
Definition: LDAPAttribute.cpp:151
Container class to store multiple string-objects.
Definition: StringList.h:15