ldapsdk  0.0.1
Public Types | Public Member Functions | Friends | List of all members
LDAPAttributeList Class Reference

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

#include <LDAPAttributeList.h>

Public Types

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

Public Member Functions

 LDAPAttributeList (const LDAPAttributeList &al)
 Copy-constructor. More...
 
 LDAPAttributeList (const LDAPAsynConnection *ld, LDAPMessage *msg)
 For internal use only. More...
 
 LDAPAttributeList ()
 Constructs an empty list. More...
 
virtual ~LDAPAttributeList ()
 Destructor. More...
 
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. More...
 
void addAttribute (const LDAPAttribute &attr)
 Adds one element to the end of the list. More...
 
void delAttribute (const std::string &type)
 Deletes all values of an Attribute for the list. More...
 
void replaceAttribute (const LDAPAttribute &attr)
 Replace an Attribute in the List. More...
 
LDAPMod ** toLDAPModArray () const
 Translates the list of Attributes to a 0-terminated array of LDAPMod-structures as needed by the C-API. More...
 

Friends

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

Detailed Description

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

Member Typedef Documentation

◆ const_iterator

typedef ListType::const_iterator LDAPAttributeList::const_iterator

◆ iterator

typedef ListType::iterator LDAPAttributeList::iterator

Constructor & Destructor Documentation

◆ LDAPAttributeList() [1/3]

LDAPAttributeList::LDAPAttributeList ( const LDAPAttributeList al)

Copy-constructor.

References DEBUG, and LDAP_DEBUG_CONSTRUCT.

◆ LDAPAttributeList() [2/3]

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 DEBUG, LDAPAsynConnection::getSessionHandle(), and LDAP_DEBUG_CONSTRUCT.

◆ LDAPAttributeList() [3/3]

LDAPAttributeList::LDAPAttributeList ( )

Constructs an empty list.

References DEBUG, and LDAP_DEBUG_CONSTRUCT.

◆ ~LDAPAttributeList()

LDAPAttributeList::~LDAPAttributeList ( )
virtual

Destructor.

References DEBUG, and LDAP_DEBUG_DESTROY.

Member Function Documentation

◆ addAttribute()

void LDAPAttributeList::addAttribute ( const LDAPAttribute attr)

Adds one element to the end of the list.

Parameters
attrThe 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 LdifReader::getEntryRecord().

◆ begin()

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

References DEBUG, and LDAP_DEBUG_TRACE.

Referenced by LdifWriter::writeRecord().

◆ delAttribute()

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

Deletes all values of an Attribute for the list.

Parameters
typeThe attribute type to be deleted.

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

Referenced by LdifReader::getEntryRecord().

◆ empty()

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

References DEBUG, and LDAP_DEBUG_TRACE.

◆ end()

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.

◆ getAttributeByName()

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

Get an Attribute by its AttributeType.

Parameters
nameThe 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

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

Referenced by LdifReader::getEntryRecord().

◆ replaceAttribute()

void LDAPAttributeList::replaceAttribute ( const LDAPAttribute attr)

Replace an Attribute in the List.

Parameters
attrThe attribute to add to the list.

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

◆ size()

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

References DEBUG, and LDAP_DEBUG_TRACE.

◆ toLDAPModArray()

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

◆ operator<<

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: