2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #include "LDAPModList.h"
12 LDAPModList::LDAPModList(){
13 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPModList::LDAPModList()" << endl);
16 LDAPModList::LDAPModList(const LDAPModList& ml){
17 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPModList::LDAPModList(&)" << endl);
18 m_modList=ml.m_modList;
21 void LDAPModList::addModification(const LDAPModification &mod){
22 DEBUG(LDAP_DEBUG_TRACE,"LDAPModList::addModification()" << endl);
23 m_modList.push_back(mod);
26 LDAPMod** LDAPModList::toLDAPModArray(){
27 DEBUG(LDAP_DEBUG_TRACE,"LDAPModList::toLDAPModArray()" << endl);
28 LDAPMod **ret = (LDAPMod**) malloc(
29 (m_modList.size()+1) * sizeof(LDAPMod*));
30 ret[m_modList.size()]=0;
31 ModList::const_iterator i;
33 for (i=m_modList.begin(); i != m_modList.end(); i++ , j++){
34 ret[j]=i->toLDAPMod();