Back to index

openldap  2.4.31
LDAPAttributeList.h
Go to the documentation of this file.
00001 // $OpenLDAP$
00002 /*
00003  * Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved.
00004  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
00005  */
00006 
00007 
00008 #ifndef LDAP_ATTRIBUTE_LIST_H
00009 #define LDAP_ATTRIBUTE_LIST_H
00010 
00011 #include <ldap.h>
00012 #include <list>
00013 #include <string>
00014 
00015 class LDAPAttribute;
00016 class LDAPAsynConnection;
00017 class LDAPMsg;
00018 
00022 class LDAPAttributeList{
00023     typedef std::list<LDAPAttribute> ListType;
00024 
00025     private :
00026         ListType m_attrs;
00027 
00028     public :
00029         typedef ListType::const_iterator const_iterator;
00030        typedef ListType::iterator iterator;
00031 
00032 
00036         LDAPAttributeList(const LDAPAttributeList& al);
00037         
00045         LDAPAttributeList(const LDAPAsynConnection *ld, LDAPMessage *msg);
00046 
00050         LDAPAttributeList();
00051 
00055         virtual ~LDAPAttributeList();
00056 
00061         size_t size() const;
00062 
00067         bool empty() const;
00068 
00072         const_iterator begin() const;
00073         
00078         const_iterator end() const;
00079 
00086        const LDAPAttribute* getAttributeByName(const std::string& name) const;
00087 
00092         void addAttribute(const LDAPAttribute& attr);
00093         
00098         void delAttribute(const std::string& type);
00099 
00104         void replaceAttribute(const LDAPAttribute& attr);
00105 
00110         LDAPMod** toLDAPModArray() const;
00111         
00116         friend std::ostream& operator << (std::ostream& s, 
00117                                      const LDAPAttributeList& al);
00118 };
00119 
00120 #endif // LDAP_ATTRIBUTE_LIST_H
00121