2000-09-01 14:46:32 -04:00
|
|
|
/*
|
|
|
|
|
* Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
|
|
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LDAP_ENTRY_H
|
|
|
|
|
#define LDAP_ENTRY_H
|
|
|
|
|
#include <ldap.h>
|
|
|
|
|
|
2001-03-15 06:07:58 -05:00
|
|
|
#include <LDAPAsynConnection.h>
|
|
|
|
|
#include <LDAPAttributeList.h>
|
2000-09-01 14:46:32 -04:00
|
|
|
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
|
|
|
|
* This class is used to store every kind of LDAP Entry.
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
class LDAPEntry{
|
|
|
|
|
|
|
|
|
|
public :
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
|
|
|
|
* Copy-constructor
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
LDAPEntry(const LDAPEntry& entry);
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructs a new entry (also used as standard constructor).
|
|
|
|
|
*
|
|
|
|
|
* @param dn The Distinguished Name for the new entry.
|
|
|
|
|
* @param attrs The attributes for the new entry.
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
LDAPEntry(const string& dn=string(),
|
|
|
|
|
const LDAPAttributeList *attrs=new LDAPAttributeList());
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Used internally only.
|
|
|
|
|
*
|
|
|
|
|
* The constructor is used internally to create a LDAPEntry from
|
|
|
|
|
* the C-API's data structurs.
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
LDAPEntry(const LDAPAsynConnection *ld, LDAPMessage *msg);
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destructor
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
~LDAPEntry();
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the DN-attribute.
|
|
|
|
|
* @param dn: The new DN for the entry.
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
void setDN(const string& dn);
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the attributes of the entry.
|
|
|
|
|
* @param attr: A pointer to a list of the new attributes.
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
void setAttributes(LDAPAttributeList *attrs);
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @returns The current DN of the entry.
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
const string getDN() const ;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @returns A const pointer to the attributes of the entry.
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
const LDAPAttributeList* getAttributes() const;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method can be used to dump the data of a LDAPResult-Object.
|
|
|
|
|
* It is only useful for debugging purposes at the moment
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
friend ostream& operator << (ostream& s, const LDAPEntry& le);
|
2000-10-03 14:25:34 -04:00
|
|
|
|
|
|
|
|
private :
|
2001-02-19 06:34:28 -05:00
|
|
|
|
2000-10-03 14:25:34 -04:00
|
|
|
LDAPAttributeList *m_attrs;
|
|
|
|
|
string m_dn;
|
2000-09-01 14:46:32 -04:00
|
|
|
};
|
|
|
|
|
#endif //LDAP_ENTRY_H
|