summaryrefslogtreecommitdiffstats
path: root/contrib/ldapc++/src/LDAPModList.h
blob: 5b0323c857b103cd82fcf4ca9e390bd9eb06580f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// $OpenLDAP$
/*
 * Copyright 2000-2022 The OpenLDAP Foundation, All Rights Reserved.
 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 */


#ifndef LDAP_MOD_LIST_H
#define LDAP_MOD_LIST_H

#include <ldap.h>
#include <list>
#include <LDAPModification.h>

/**
 * This container class is used to store multiple LDAPModification-objects.
 */
class LDAPModList{
    typedef std::list<LDAPModification> ListType;

    public : 
        /**
         * Constructs an empty list.
         */   
        LDAPModList();
		
        /**
         * Copy-constructor
         */
        LDAPModList(const LDAPModList&);

        /**
         * Adds one element to the end of the list.
         * @param mod The LDAPModification to add to the std::list.
         */
        void addModification(const LDAPModification &mod);

        /**
         * Translates the list to a 0-terminated array of
         * LDAPMod-structures as needed by the C-API
         */
        LDAPMod** toLDAPModArray();

        /**
         * @returns true, if the ModList contains no Operations
         */
        bool empty() const;
        
        /**
         * @returns number of Modifications in the ModList
         */
        unsigned int size() const;

    private : 
        ListType m_modList;
};
#endif //LDAP_MOD_LIST_H