ldapsdk  0.0.1
LDAPEntry.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_ENTRY_H
9 #define LDAP_ENTRY_H
10 #include <ldap.h>
11 
12 #include <LDAPAttributeList.h>
13 
14 class LDAPAsynConnection;
15 
19 class LDAPEntry{
20 
21  public :
25  LDAPEntry(const LDAPEntry& entry);
26 
33  LDAPEntry(const std::string& dn=std::string(),
34  const LDAPAttributeList *attrs=0);
35 
42  LDAPEntry(const LDAPAsynConnection *ld, LDAPMessage *msg);
43 
47  ~LDAPEntry();
48 
52  LDAPEntry& operator=(const LDAPEntry& from);
53 
58  void setDN(const std::string& dn);
59 
64  void setAttributes(LDAPAttributeList *attrs);
65 
73  const LDAPAttribute* getAttributeByName(const std::string& name) const;
74 
80  void addAttribute(const LDAPAttribute& attr);
81 
87  void delAttribute(const std::string& type);
88 
94  void replaceAttribute(const LDAPAttribute& attr);
95 
99  const std::string& getDN() const ;
100 
104  const LDAPAttributeList* getAttributes() const;
105 
110  friend std::ostream& operator << (std::ostream& s, const LDAPEntry& le);
111 
112  private :
113  LDAPAttributeList *m_attrs;
114  std::string m_dn;
115 };
116 #endif //LDAP_ENTRY_H
void setDN(const std::string &dn)
Sets the DN-attribute.
Definition: LDAPEntry.cpp:54
const std::string & getDN() const
Definition: LDAPEntry.cpp:71
void replaceAttribute(const LDAPAttribute &attr)
Replace an Attribute in the List of Attributes (simple wrapper around LDAPAttributeList::replaceAttri...
Definition: LDAPEntry.cpp:96
This class represents an asynchronous connection to an LDAP-Server.
Definition: LDAPAsynConnection.h:45
~LDAPEntry()
Destructor.
Definition: LDAPEntry.cpp:42
LDAPEntry & operator=(const LDAPEntry &from)
Assignment operator.
Definition: LDAPEntry.cpp:47
Represents the name an value(s) of an Attribute.
Definition: LDAPAttribute.h:21
void addAttribute(const LDAPAttribute &attr)
Adds one Attribute to the List of Attributes (simple wrapper around LDAPAttributeList::addAttribute()...
Definition: LDAPEntry.cpp:86
void setAttributes(LDAPAttributeList *attrs)
Sets the attributes of the entry.
Definition: LDAPEntry.cpp:61
const LDAPAttributeList * getAttributes() const
Definition: LDAPEntry.cpp:76
This class is used to store every kind of LDAP Entry.
Definition: LDAPEntry.h:19
This container class is used to store multiple LDAPAttribute-objects.
Definition: LDAPAttributeList.h:22
friend std::ostream & operator<<(std::ostream &s, const LDAPEntry &le)
This method can be used to dump the data of a LDAPResult-Object.
const LDAPAttribute * getAttributeByName(const std::string &name) const
Get an Attribute by its AttributeType (simple wrapper around LDAPAttributeList::getAttributeByName() ...
Definition: LDAPEntry.cpp:81
LDAPEntry(const LDAPEntry &entry)
Copy-constructor.
Definition: LDAPEntry.cpp:16
void delAttribute(const std::string &type)
Deletes all values of an Attribute from the list of Attributes (simple wrapper around LDAPAttributeLi...
Definition: LDAPEntry.cpp:91