+// $OpenLDAP$
/*
- * Copyright 2000-2007, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
}
}
-void LDAPAttributeList::replaceAttribute(const LDAPAttribute& attr)
+void LDAPAttributeList::delAttribute(const std::string& type)
{
DEBUG(LDAP_DEBUG_TRACE,"LDAPAttribute::replaceAttribute()" << endl);
- DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
- " attr:" << attr << endl);
-
+ DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER, " type: " << type << endl);
LDAPAttributeList::iterator i;
for( i = m_attrs.begin(); i != m_attrs.end(); i++){
- if(attr.getName().size() == i->getName().size()){
- if(equal(attr.getName().begin(), attr.getName().end(), i->getName().begin(),
+ if(type.size() == i->getName().size()){
+ if(equal(type.begin(), type.end(), i->getName().begin(),
nocase_compare)){
m_attrs.erase(i);
break;
}
}
}
+}
+
+void LDAPAttributeList::replaceAttribute(const LDAPAttribute& attr)
+{
+ DEBUG(LDAP_DEBUG_TRACE,"LDAPAttribute::replaceAttribute()" << endl);
+ DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
+ " attr:" << attr << endl);
+
+ LDAPAttributeList::iterator i;
+ this->delAttribute( attr.getName() );
m_attrs.push_back(attr);
}