]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPModList.h
0066c9da20ad342ed89cb9d9aaff01bdf7a658b2
[openldap] / contrib / ldapc++ / src / LDAPModList.h
1 // $OpenLDAP$
2 /*
3  * Copyright 2000-2017 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7
8 #ifndef LDAP_MOD_LIST_H
9 #define LDAP_MOD_LIST_H
10
11 #include <ldap.h>
12 #include <list>
13 #include <LDAPModification.h>
14
15 /**
16  * This container class is used to store multiple LDAPModification-objects.
17  */
18 class LDAPModList{
19     typedef std::list<LDAPModification> ListType;
20
21     public : 
22         /**
23          * Constructs an empty list.
24          */   
25         LDAPModList();
26                 
27         /**
28          * Copy-constructor
29          */
30         LDAPModList(const LDAPModList&);
31
32         /**
33          * Adds one element to the end of the list.
34          * @param mod The LDAPModification to add to the std::list.
35          */
36         void addModification(const LDAPModification &mod);
37
38         /**
39          * Translates the list to a 0-terminated array of
40          * LDAPMod-structures as needed by the C-API
41          */
42         LDAPMod** toLDAPModArray();
43
44         /**
45          * @returns true, if the ModList contains no Operations
46          */
47         bool empty() const;
48         
49         /**
50          * @returns number of Modifications in the ModList
51          */
52         unsigned int size() const;
53
54     private : 
55         ListType m_modList;
56 };
57 #endif //LDAP_MOD_LIST_H
58
59