ldapsdk  0.0.1
LDAPAttributeList.h
Go to the documentation of this file.
1 // $OpenLDAP$
2 /*
3  * Copyright 2000-2011 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6 
7 
8 #ifndef LDAP_ATTRIBUTE_LIST_H
9 #define LDAP_ATTRIBUTE_LIST_H
10 
11 #include <ldap.h>
12 #include <list>
13 #include <string>
14 
15 class LDAPAttribute;
16 class LDAPAsynConnection;
17 class LDAPMsg;
18 
23  typedef std::list<LDAPAttribute> ListType;
24 
25  private :
26  ListType m_attrs;
27 
28  public :
29  typedef ListType::const_iterator const_iterator;
30  typedef ListType::iterator iterator;
31 
32 
37 
45  LDAPAttributeList(const LDAPAsynConnection *ld, LDAPMessage *msg);
46 
51 
55  virtual ~LDAPAttributeList();
56 
61  size_t size() const;
62 
67  bool empty() const;
68 
72  const_iterator begin() const;
73 
78  const_iterator end() const;
79 
86  const LDAPAttribute* getAttributeByName(const std::string& name) const;
87 
92  void addAttribute(const LDAPAttribute& attr);
93 
98  void delAttribute(const std::string& type);
99 
104  void replaceAttribute(const LDAPAttribute& attr);
105 
110  LDAPMod** toLDAPModArray() const;
111 
116  friend std::ostream& operator << (std::ostream& s,
117  const LDAPAttributeList& al);
118 };
119 
120 #endif // LDAP_ATTRIBUTE_LIST_H
121