LDAPAttributeList Class Reference

This container class is used to store multiple LDAPAttribute-objects. More...

#include <LDAPAttributeList.h>

List of all members.

Public Types

typedef ListType::const_iterator const_iterator
typedef ListType::iterator iterator

Public Member Functions

 LDAPAttributeList (const LDAPAttributeList &al)
 Copy-constructor.
 LDAPAttributeList (const LDAPAsynConnection *ld, LDAPMessage *msg)
 For internal use only.
 LDAPAttributeList ()
 Constructs an empty list.
virtual ~LDAPAttributeList ()
 Destructor.
size_t size () const
bool empty () const
const_iterator begin () const
const_iterator end () const
const LDAPAttributegetAttributeByName (const std::string &name) const
 Get an Attribute by its AttributeType.
void addAttribute (const LDAPAttribute &attr)
 Adds one element to the end of the list.
void delAttribute (const std::string &type)
 Deletes all values of an Attribute for the list.
void replaceAttribute (const LDAPAttribute &attr)
 Replace an Attribute in the List.
LDAPMod ** toLDAPModArray () const
 Translates the list of Attributes to a 0-terminated array of LDAPMod-structures as needed by the C-API.

Friends

std::ostream & operator<< (std::ostream &s, const LDAPAttributeList &al)
 This method can be used to dump the data of a LDAPResult-Object.

Detailed Description

This container class is used to store multiple LDAPAttribute-objects.


Member Typedef Documentation

typedef ListType::const_iterator LDAPAttributeList::const_iterator
typedef ListType::iterator LDAPAttributeList::iterator

Constructor & Destructor Documentation

LDAPAttributeList::LDAPAttributeList ( const LDAPAttributeList al  ) 

Copy-constructor.

References DEBUG, and LDAP_DEBUG_CONSTRUCT.

LDAPAttributeList::LDAPAttributeList ( const LDAPAsynConnection ld,
LDAPMessage *  msg 
)

For internal use only.

This constructor is used by the library internally to create a list of attributes from a LDAPMessage-struct that was return by the C-API

References addAttribute(), DEBUG, LDAPAsynConnection::getSessionHandle(), and LDAP_DEBUG_CONSTRUCT.

LDAPAttributeList::LDAPAttributeList (  ) 

Constructs an empty list.

References DEBUG, and LDAP_DEBUG_CONSTRUCT.

LDAPAttributeList::~LDAPAttributeList (  )  [virtual]

Destructor.

References DEBUG, and LDAP_DEBUG_DESTROY.


Member Function Documentation

void LDAPAttributeList::addAttribute ( const LDAPAttribute attr  ) 

Adds one element to the end of the list.

Parameters:
attr The attribute to add to the list.

References StringList::begin(), DEBUG, StringList::end(), LDAPAttribute::getName(), LDAPAttribute::getValues(), LDAP_DEBUG_PARAMETER, LDAP_DEBUG_TRACE, and nocase_compare().

Referenced by LDAPEntry::addAttribute(), LdifReader::getEntryRecord(), and LDAPAttributeList().

LDAPAttributeList::const_iterator LDAPAttributeList::begin (  )  const
Returns:
A iterator that points to the first element of the list.

References DEBUG, and LDAP_DEBUG_TRACE.

void LDAPAttributeList::delAttribute ( const std::string &  type  ) 

Deletes all values of an Attribute for the list.

Parameters:
type The attribute type to be deleted.

References DEBUG, LDAP_DEBUG_PARAMETER, LDAP_DEBUG_TRACE, and nocase_compare().

Referenced by LDAPEntry::delAttribute(), LdifReader::getEntryRecord(), and replaceAttribute().

bool LDAPAttributeList::empty (  )  const
Returns:
true if there are zero LDAPAttribute-objects currently stored in this list.

References DEBUG, and LDAP_DEBUG_TRACE.

LDAPAttributeList::const_iterator LDAPAttributeList::end (  )  const
Returns:
A iterator that points to the element after the last element of the list.

References DEBUG, and LDAP_DEBUG_TRACE.

const LDAPAttribute* LDAPAttributeList::getAttributeByName ( const std::string &  name  )  const

Get an Attribute by its AttributeType.

Parameters:
name The name of the Attribute to look for
Returns:
a pointer to the LDAPAttribute with the AttributeType "name" or 0, if there is no Attribute of that Type

Referenced by LDAPEntry::getAttributeByName(), and LdifReader::getEntryRecord().

void LDAPAttributeList::replaceAttribute ( const LDAPAttribute attr  ) 

Replace an Attribute in the List.

Parameters:
attr The attribute to add to the list.

References DEBUG, delAttribute(), LDAPAttribute::getName(), LDAP_DEBUG_PARAMETER, and LDAP_DEBUG_TRACE.

Referenced by LDAPEntry::replaceAttribute().

size_t LDAPAttributeList::size (  )  const
Returns:
The number of LDAPAttribute-objects that are currently stored in this list.

References DEBUG, and LDAP_DEBUG_TRACE.

LDAPMod ** LDAPAttributeList::toLDAPModArray (  )  const

Translates the list of Attributes to a 0-terminated array of LDAPMod-structures as needed by the C-API.

References DEBUG, and LDAP_DEBUG_TRACE.

Referenced by LDAPAddRequest::sendRequest().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const LDAPAttributeList al 
) [friend]

This method can be used to dump the data of a LDAPResult-Object.

It is only useful for debugging purposes at the moment


The documentation for this class was generated from the following files:
Generated on Mon Jul 5 13:45:11 2010 for ldapsdk by  doxygen 1.6.3