diff options
| author | lukem <lukem@NetBSD.org> | 2008-05-22 14:20:36 +0000 |
|---|---|---|
| committer | lukem <lukem@NetBSD.org> | 2008-05-22 14:20:36 +0000 |
| commit | 2de962bd804263c16657f586aa00f1704045df8e (patch) | |
| tree | de806e37dad8e2cdc2b74d4ae710b3e206f57c6e /external/bsd/openldap/dist/contrib/ldapc++/src/LDAPModification.cpp | |
| parent | fe8ce90e3d5113866c6ee78ea62701e8f5723d1d (diff) | |
OpenLDAP 2.4.9
Diffstat (limited to 'external/bsd/openldap/dist/contrib/ldapc++/src/LDAPModification.cpp')
| -rw-r--r-- | external/bsd/openldap/dist/contrib/ldapc++/src/LDAPModification.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/external/bsd/openldap/dist/contrib/ldapc++/src/LDAPModification.cpp b/external/bsd/openldap/dist/contrib/ldapc++/src/LDAPModification.cpp new file mode 100644 index 00000000000..11dadb32d13 --- /dev/null +++ b/external/bsd/openldap/dist/contrib/ldapc++/src/LDAPModification.cpp @@ -0,0 +1,40 @@ +// $OpenLDAP: pkg/ldap/contrib/ldapc++/src/LDAPModification.cpp,v 1.4.10.1 2008/04/14 23:09:26 quanah Exp $ +/* + * Copyright 2000, OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ + + +#include "LDAPModification.h" +#include "debug.h" + +using namespace std; + +LDAPModification::LDAPModification(const LDAPAttribute& attr, mod_op op){ + DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPModification::LDAPModification()" << endl); + DEBUG(LDAP_DEBUG_CONSTRUCT | LDAP_DEBUG_PARAMETER, + " attr:" << attr << endl); + m_attr = attr; + m_mod_op = op; +} + +LDAPMod* LDAPModification::toLDAPMod() const { + DEBUG(LDAP_DEBUG_TRACE,"LDAPModification::toLDAPMod()" << endl); + LDAPMod* ret=m_attr.toLDAPMod(); + + //The mod_op value of the LDAPMod-struct needs to be ORed with the right + // LDAP_MOD_* constant to preserve the BIN-flag (see CAPI-draft for + // explanation of the LDAPMod struct) + switch (m_mod_op){ + case OP_ADD : + ret->mod_op |= LDAP_MOD_ADD; + break; + case OP_DELETE : + ret->mod_op |= LDAP_MOD_DELETE; + break; + case OP_REPLACE : + ret->mod_op |= LDAP_MOD_REPLACE; + break; + } + return ret; +} |
