2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
10 #include "LDAPException.h"
12 LDAPEntry::LDAPEntry(const LDAPEntry& entry){
13 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPEntry::LDAPEntry(&)" << endl);
15 m_attrs=new LDAPAttributeList( *(entry.m_attrs));
19 LDAPEntry::LDAPEntry(const string& dn, const LDAPAttributeList *attrs){
20 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPEntry::LDAPEntry()" << endl);
21 DEBUG(LDAP_DEBUG_CONSTRUCT | LDAP_DEBUG_PARAMETER,
22 " dn:" << dn << endl << " attrs:" << *attrs << endl);
23 m_attrs=new LDAPAttributeList(*attrs);
27 LDAPEntry::LDAPEntry(const LDAPAsynConnection *ld, LDAPMessage *msg){
28 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPEntry::LDAPEntry()" << endl);
29 char* tmp=ldap_get_dn(ld->getSessionHandle(),msg);
32 m_attrs = new LDAPAttributeList(ld, msg);
35 LDAPEntry::~LDAPEntry(){
36 DEBUG(LDAP_DEBUG_DESTROY,"LDAPEntry::~LDAPEntry()" << endl);
40 void LDAPEntry::setDN(const string& dn){
41 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::setDN()" << endl);
42 DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
43 " dn:" << dn << endl);
47 void LDAPEntry::setAttributes(LDAPAttributeList *attrs){
48 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::setAttributes()" << endl);
49 DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
50 " attrs:" << *attrs << endl);
57 const string LDAPEntry::getDN() const{
58 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::getDN()" << endl);
62 const LDAPAttributeList* LDAPEntry::getAttributes() const{
63 DEBUG(LDAP_DEBUG_TRACE,"LDAPEntry::getAttributes()" << endl);
67 ostream& operator << (ostream& s, const LDAPEntry& le){
68 s << "DN: " << le.m_dn << ": " << *(le.m_attrs);