X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=contrib%2Fldapc%2B%2B%2Fsrc%2FLDAPModList.h;h=6e49a3f108bcf10a7c4b521f3c7750e895b762b3;hb=cfa8dd6884f7d45154fb92651fd6e04aeb93dd0b;hp=6c6cb702f6ffbe9a5faae4248b17349bff4d27fc;hpb=84d0e262348b5c3ac877ce49424df89d7cb5fdff;p=openldap diff --git a/contrib/ldapc++/src/LDAPModList.h b/contrib/ldapc++/src/LDAPModList.h index 6c6cb702f6..6e49a3f108 100644 --- a/contrib/ldapc++/src/LDAPModList.h +++ b/contrib/ldapc++/src/LDAPModList.h @@ -1,30 +1,58 @@ +// $OpenLDAP$ /* - * Copyright 2000, OpenLDAP Foundation, All Rights Reserved. + * Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ -// $Id: LDAPModList.h,v 1.3 2000/08/31 17:43:49 rhafer Exp $ #ifndef LDAP_MOD_LIST_H #define LDAP_MOD_LIST_H #include #include -#include "LDAPModification.h" - -typedef list ModList; +#include +/** + * This container class is used to store multiple LDAPModification-objects. + */ class LDAPModList{ - private : - ModList m_modList; - - public : - LDAPModList(); - LDAPModList(const LDAPModList&); - - void addModification(const LDAPModification &mod); - LDAPMod** toLDAPModArray(); - + 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