2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
10 #include "LDAPException.h"
14 LDAPEntry::LDAPEntry(const LDAPEntry& entry){
15 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPEntry::LDAPEntry(&)" << endl);
17 m_attrs=new LDAPAttributeList( *(entry.m_attrs));
21 LDAPEntry::LDAPEntry(const string& dn, const LDAPAttributeList *attrs){
22 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPEntry::LDAPEntry()" << endl);
23 DEBUG(LDAP_DEBUG_CONSTRUCT | LDAP_DEBUG_PARAMETER,
24 " dn:" << dn << endl << " attrs:" << *attrs << endl);
25 m_attrs=new LDAPAttributeList(*attrs);
29 LDAPEntry::LDAPEntry(const LDAPAsynConnection *ld, LDAPMessage *msg){
30 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPEntry::LDAPEntry()" << endl);
31 char* tmp=ldap_get_dn(ld->getSessionHandle(),msg);
34 m_attrs = new LDAPAttributeList(ld, msg);
37 LDAPEntry::~LDAPEntry(){
38 DEBUG(LDAP_DEBUG_DESTROY,"LDAPEntry::~LDAPEntry()" << endl);
42 void LDAPEntry::setDN(const string& dn){
43 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::setDN()" << endl);
44 DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
45 " dn:" << dn << endl);
49 void LDAPEntry::setAttributes(LDAPAttributeList *attrs){
50 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::setAttributes()" << endl);
51 DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
52 " attrs:" << *attrs << endl);
59 const string& LDAPEntry::getDN() const{
60 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::getDN()" << endl);
64 const LDAPAttributeList* LDAPEntry::getAttributes() const{
65 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::getAttributes()" << endl);
69 ostream& operator << (ostream& s, const LDAPEntry& le){
70 s << "DN: " << le.m_dn << ": " << *(le.m_attrs);