3 * Copyright 2000-2013 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
8 #include "LDAPModList.h"
15 LDAPModList::LDAPModList(){
16 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPModList::LDAPModList()" << endl);
19 LDAPModList::LDAPModList(const LDAPModList& ml){
20 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPModList::LDAPModList(&)" << endl);
21 m_modList=ml.m_modList;
24 void LDAPModList::addModification(const LDAPModification &mod){
25 DEBUG(LDAP_DEBUG_TRACE,"LDAPModList::addModification()" << endl);
26 m_modList.push_back(mod);
29 LDAPMod** LDAPModList::toLDAPModArray(){
30 DEBUG(LDAP_DEBUG_TRACE,"LDAPModList::toLDAPModArray()" << endl);
31 LDAPMod **ret = (LDAPMod**) malloc(
32 (m_modList.size()+1) * sizeof(LDAPMod*));
33 ret[m_modList.size()]=0;
34 LDAPModList::ListType::const_iterator i;
36 for (i=m_modList.begin(); i != m_modList.end(); i++ , j++){
37 ret[j]=i->toLDAPMod();
42 bool LDAPModList::empty() const {
43 return m_modList.empty();
46 unsigned int LDAPModList::size() const {
47 return m_modList.size();