From 7731832751ab9f3c6ddeb66f186d3d7fa1934a6d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 13:11:40 +0200 Subject: Adding upstream version 2.4.57+dfsg. Signed-off-by: Daniel Baumann --- contrib/ldapc++/src/LDAPModList.h | 59 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 contrib/ldapc++/src/LDAPModList.h (limited to 'contrib/ldapc++/src/LDAPModList.h') diff --git a/contrib/ldapc++/src/LDAPModList.h b/contrib/ldapc++/src/LDAPModList.h new file mode 100644 index 0000000..63be9e7 --- /dev/null +++ b/contrib/ldapc++/src/LDAPModList.h @@ -0,0 +1,59 @@ +// $OpenLDAP$ +/* + * Copyright 2000-2021 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ + + +#ifndef LDAP_MOD_LIST_H +#define LDAP_MOD_LIST_H + +#include +#include +#include + +/** + * This container class is used to store multiple LDAPModification-objects. + */ +class LDAPModList{ + typedef std::list 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 + + -- cgit v1.2.3