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