2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #ifndef LDAP_ATTRIBUTE_LIST_H
8 #define LDAP_ATTRIBUTE_LIST_H
12 class LDAPAsynConnection;
15 typedef list<LDAPAttribute> AttrList;
18 * This container class is used to store multiple LDAPAttribute-objects.
20 class LDAPAttributeList{
25 typedef AttrList::const_iterator const_iterator;
31 LDAPAttributeList(const LDAPAttributeList& al);
34 * For internal use only
36 * This constructor is used by the library internally to create a
37 * list of attributes from a LDAPMessage-struct that was return by
40 LDAPAttributeList(const LDAPAsynConnection *ld, LDAPMessage *msg);
43 * Constructs an empty list.
50 virtual ~LDAPAttributeList();
53 * @return The number of LDAPAttribute-objects that are currently
54 * stored in this list.
59 * @return A iterator that points to the first element of the list.
61 const_iterator begin() const;
64 * @return A iterator that points to the element after the last
65 * element of the list.
67 const_iterator end() const;
70 * Adds one element to the end of the list.
71 * @param attr The attribute to add to the list.
73 void addAttribute(const LDAPAttribute& attr);
76 * Translates the list of Attributes to a 0-terminated array of
77 * LDAPMod-structures as needed by the C-API
79 LDAPMod** toLDAPModArray() const;
82 * This method can be used to dump the data of a LDAPResult-Object.
83 * It is only useful for debugging purposes at the moment
85 friend ostream& operator << (ostream& s, const LDAPAttributeList& al);
87 #endif // LDAP_ATTRIBUTE_LIST_H