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
13 class LDAPAsynConnection;
16 typedef std::list<LDAPAttribute> AttrList;
19 * This container class is used to store multiple LDAPAttribute-objects.
21 class LDAPAttributeList{
26 typedef AttrList::const_iterator const_iterator;
32 LDAPAttributeList(const LDAPAttributeList& al);
35 * For internal use only
37 * This constructor is used by the library internally to create a
38 * list of attributes from a LDAPMessage-struct that was return by
41 LDAPAttributeList(const LDAPAsynConnection *ld, LDAPMessage *msg);
44 * Constructs an empty list.
51 virtual ~LDAPAttributeList();
54 * @return The number of LDAPAttribute-objects that are currently
55 * stored in this list.
60 * @return true if there are zero LDAPAttribute-objects currently
61 * stored in this list.
66 * @return A iterator that points to the first element of the list.
68 const_iterator begin() const;
71 * @return A iterator that points to the element after the last
72 * element of the list.
74 const_iterator end() const;
77 * Adds one element to the end of the list.
78 * @param attr The attribute to add to the list.
80 void addAttribute(const LDAPAttribute& attr);
83 * Translates the list of Attributes to a 0-terminated array of
84 * LDAPMod-structures as needed by the C-API
86 LDAPMod** toLDAPModArray() const;
89 * This method can be used to dump the data of a LDAPResult-Object.
90 * It is only useful for debugging purposes at the moment
92 friend std::ostream& operator << (std::ostream& s,
93 const LDAPAttributeList& al);
95 #endif // LDAP_ATTRIBUTE_LIST_H