]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPModList.cpp
876b6ddb88ce53c2e6d5cb7386d6bb105afc48ef
[openldap] / contrib / ldapc++ / src / LDAPModList.cpp
1 /*
2  * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6
7 #include "LDAPModList.h"
8 #include "debug.h"
9
10 LDAPModList::LDAPModList(){
11     DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPModList::LDAPModList()" << endl);
12 }
13
14 LDAPModList::LDAPModList(const LDAPModList& ml){
15     DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPModList::LDAPModList(&)" << endl);
16     m_modList=ml.m_modList;
17 }
18
19 void LDAPModList::addModification(const LDAPModification &mod){
20     DEBUG(LDAP_DEBUG_TRACE,"LDAPModList::addModification()" << endl);
21         m_modList.push_back(mod);
22 }
23
24 LDAPMod** LDAPModList::toLDAPModArray(){
25     DEBUG(LDAP_DEBUG_TRACE,"LDAPModList::toLDAPModArray()" << endl);
26         LDAPMod **ret = new LDAPMod*[m_modList.size()+1];
27         ret[m_modList.size()]=0;
28         ModList::const_iterator i;
29         int j=0;
30         for (i=m_modList.begin(); i != m_modList.end(); i++ , j++){
31                 ret[j]=i->toLDAPMod();
32         }
33         return ret;
34 }