2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #include "LDAPModification.h"
12 LDAPModification::LDAPModification(const LDAPAttribute& attr, mod_op op){
13 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPModification::LDAPModification()" << endl);
14 DEBUG(LDAP_DEBUG_CONSTRUCT | LDAP_DEBUG_PARAMETER,
15 " attr:" << attr << endl);
20 LDAPMod* LDAPModification::toLDAPMod() const {
21 DEBUG(LDAP_DEBUG_TRACE,"LDAPModification::toLDAPMod()" << endl);
22 LDAPMod* ret=m_attr.toLDAPMod();
24 //The mod_op value of the LDAPMod-struct needs to be ORed with the right
25 // LDAP_MOD_* constant to preserve the BIN-flag (see CAPI-draft for
26 // explanation of the LDAPMod struct)
29 ret->mod_op |= LDAP_MOD_ADD;
32 ret->mod_op |= LDAP_MOD_DELETE;
35 ret->mod_op |= LDAP_MOD_REPLACE;