2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
10 #include "LDAPAsynConnection.h"
11 #include "LDAPException.h"
15 LDAPEntry::LDAPEntry(const LDAPEntry& entry){
16 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPEntry::LDAPEntry(&)" << endl);
18 m_attrs=new LDAPAttributeList( *(entry.m_attrs));
22 LDAPEntry::LDAPEntry(const string& dn, const LDAPAttributeList *attrs){
23 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPEntry::LDAPEntry()" << endl);
24 DEBUG(LDAP_DEBUG_CONSTRUCT | LDAP_DEBUG_PARAMETER,
25 " dn:" << dn << endl << " attrs:" << *attrs << endl);
26 m_attrs=new LDAPAttributeList(*attrs);
30 LDAPEntry::LDAPEntry(const LDAPAsynConnection *ld, LDAPMessage *msg){
31 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPEntry::LDAPEntry()" << endl);
32 char* tmp=ldap_get_dn(ld->getSessionHandle(),msg);
35 m_attrs = new LDAPAttributeList(ld, msg);
38 LDAPEntry::~LDAPEntry(){
39 DEBUG(LDAP_DEBUG_DESTROY,"LDAPEntry::~LDAPEntry()" << endl);
43 void LDAPEntry::setDN(const string& dn){
44 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::setDN()" << endl);
45 DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
46 " dn:" << dn << endl);
50 void LDAPEntry::setAttributes(LDAPAttributeList *attrs){
51 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::setAttributes()" << endl);
52 DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
53 " attrs:" << *attrs << endl);
60 const string& LDAPEntry::getDN() const{
61 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::getDN()" << endl);
65 const LDAPAttributeList* LDAPEntry::getAttributes() const{
66 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::getAttributes()" << endl);
70 ostream& operator << (ostream& s, const LDAPEntry& le){
71 s << "DN: " << le.m_dn << ": " << *(le.m_attrs);