2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <LDAPAttributeList.h>
13 class LDAPAsynConnection;
16 * This class is used to store every kind of LDAP Entry.
24 LDAPEntry(const LDAPEntry& entry);
27 * Constructs a new entry (also used as standard constructor).
29 * @param dn The Distinguished Name for the new entry.
30 * @param attrs The attributes for the new entry.
32 LDAPEntry(const std::string& dn=std::string(),
33 const LDAPAttributeList *attrs=new LDAPAttributeList());
36 * Used internally only.
38 * The constructor is used internally to create a LDAPEntry from
39 * the C-API's data structurs.
41 LDAPEntry(const LDAPAsynConnection *ld, LDAPMessage *msg);
49 * Sets the DN-attribute.
50 * @param dn: The new DN for the entry.
52 void setDN(const std::string& dn);
55 * Sets the attributes of the entry.
56 * @param attr: A pointer to a std::list of the new attributes.
58 void setAttributes(LDAPAttributeList *attrs);
61 * Get an Attribute by its AttributeType (simple wrapper around
62 * LDAPAttributeList::getAttributeByName() )
63 * @param name The name of the Attribute to look for
64 * @return a pointer to the LDAPAttribute with the AttributeType
65 * "name" or 0, if there is no Attribute of that Type
67 const LDAPAttribute* getAttributeByName(const std::string& name) const;
70 * Adds one Attribute to the List of Attributes (simple wrapper around
71 * LDAPAttributeList::addAttribute() ).
72 * @param attr The attribute to add to the list.
74 void addAttribute(const LDAPAttribute& attr);
77 * Replace an Attribute in the List of Attributes (simple wrapper
78 * around LDAPAttributeList::replaceAttribute() ).
79 * @param attr The attribute to add to the list.
81 void replaceAttribute(const LDAPAttribute& attr);
84 * @returns The current DN of the entry.
86 const std::string& getDN() const ;
89 * @returns A const pointer to the attributes of the entry.
91 const LDAPAttributeList* getAttributes() const;
94 * This method can be used to dump the data of a LDAPResult-Object.
95 * It is only useful for debugging purposes at the moment
97 friend std::ostream& operator << (std::ostream& s, const LDAPEntry& le);
100 LDAPAttributeList *m_attrs;
103 #endif //LDAP_ENTRY_H