ldapsdk 0.0.1
|
00001 // $OpenLDAP$ 00002 /* 00003 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved. 00004 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file 00005 */ 00006 00007 00008 #ifndef LDAP_ENTRY_H 00009 #define LDAP_ENTRY_H 00010 #include <ldap.h> 00011 00012 #include <LDAPAttributeList.h> 00013 00014 class LDAPAsynConnection; 00015 00019 class LDAPEntry{ 00020 00021 public : 00025 LDAPEntry(const LDAPEntry& entry); 00026 00033 LDAPEntry(const std::string& dn=std::string(), 00034 const LDAPAttributeList *attrs=0); 00035 00042 LDAPEntry(const LDAPAsynConnection *ld, LDAPMessage *msg); 00043 00047 ~LDAPEntry(); 00048 00052 LDAPEntry& operator=(const LDAPEntry& from); 00053 00058 void setDN(const std::string& dn); 00059 00064 void setAttributes(LDAPAttributeList *attrs); 00065 00073 const LDAPAttribute* getAttributeByName(const std::string& name) const; 00074 00080 void addAttribute(const LDAPAttribute& attr); 00081 00087 void delAttribute(const std::string& type); 00088 00094 void replaceAttribute(const LDAPAttribute& attr); 00095 00099 const std::string& getDN() const ; 00100 00104 const LDAPAttributeList* getAttributes() const; 00105 00110 friend std::ostream& operator << (std::ostream& s, const LDAPEntry& le); 00111 00112 private : 00113 LDAPAttributeList *m_attrs; 00114 std::string m_dn; 00115 }; 00116 #endif //LDAP_ENTRY_H