]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPModList.h
Update guide Copyright/License handling
[openldap] / contrib / ldapc++ / src / LDAPModList.h
index 6fc1d74afa4153c66558dcf3ca7738db697174c8..01c996386ca4ba886d9b976b316ea9ff66375374 100644 (file)
@@ -1,5 +1,6 @@
+// $OpenLDAP$
 /*
- * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2000-2011 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
 
 #include <ldap.h>
 #include <list>
-#include "LDAPModification.h"
-
-typedef list<LDAPModification> ModList;
+#include <LDAPModification.h>
 
 /**
  * This container class is used to store multiple LDAPModification-objects.
  */
 class LDAPModList{
+    typedef std::list<LDAPModification> ListType;
 
-       public : 
+    public : 
         /**
          * Constructs an empty list.
          */   
-               LDAPModList();
+        LDAPModList();
                
         /**
          * Copy-constructor
@@ -31,9 +31,9 @@ class LDAPModList{
 
         /**
          * Adds one element to the end of the list.
-         * @param mod The LDAPModification to add to the list.
+         * @param mod The LDAPModification to add to the std::list.
          */
-               void addModification(const LDAPModification &mod);
+        void addModification(const LDAPModification &mod);
 
         /**
          * Translates the list to a 0-terminated array of
@@ -41,8 +41,18 @@ class LDAPModList{
          */
         LDAPMod** toLDAPModArray();
 
-       private : 
-               ModList m_modList;
+        /**
+         * @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