1
// $OpenLDAP: pkg/ldap/contrib/ldapc++/src/LDAPEntry.h,v 1.6.8.5 2008/04/14 23:30:47 quanah Exp $
3
* Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
4
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12
#include <LDAPAttributeList.h>
14
class LDAPAsynConnection;
17
* This class is used to store every kind of LDAP Entry.
25
LDAPEntry(const LDAPEntry& entry);
28
* Constructs a new entry (also used as standard constructor).
30
* @param dn The Distinguished Name for the new entry.
31
* @param attrs The attributes for the new entry.
33
LDAPEntry(const std::string& dn=std::string(),
34
const LDAPAttributeList *attrs=0);
37
* Used internally only.
39
* The constructor is used internally to create a LDAPEntry from
40
* the C-API's data structurs.
42
LDAPEntry(const LDAPAsynConnection *ld, LDAPMessage *msg);
52
LDAPEntry& operator=(const LDAPEntry& from);
55
* Sets the DN-attribute.
56
* @param dn: The new DN for the entry.
58
void setDN(const std::string& dn);
61
* Sets the attributes of the entry.
62
* @param attr: A pointer to a std::list of the new attributes.
64
void setAttributes(LDAPAttributeList *attrs);
67
* Get an Attribute by its AttributeType (simple wrapper around
68
* LDAPAttributeList::getAttributeByName() )
69
* @param name The name of the Attribute to look for
70
* @return a pointer to the LDAPAttribute with the AttributeType
71
* "name" or 0, if there is no Attribute of that Type
73
const LDAPAttribute* getAttributeByName(const std::string& name) const;
76
* Adds one Attribute to the List of Attributes (simple wrapper around
77
* LDAPAttributeList::addAttribute() ).
78
* @param attr The attribute to add to the list.
80
void addAttribute(const LDAPAttribute& attr);
83
* Replace an Attribute in the List of Attributes (simple wrapper
84
* around LDAPAttributeList::replaceAttribute() ).
85
* @param attr The attribute to add to the list.
87
void replaceAttribute(const LDAPAttribute& attr);
90
* @returns The current DN of the entry.
92
const std::string& getDN() const ;
95
* @returns A const pointer to the attributes of the entry.
97
const LDAPAttributeList* getAttributes() const;
100
* This method can be used to dump the data of a LDAPResult-Object.
101
* It is only useful for debugging purposes at the moment
103
friend std::ostream& operator << (std::ostream& s, const LDAPEntry& le);
106
LDAPAttributeList *m_attrs;
109
#endif //LDAP_ENTRY_H