Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
9aac6e02
Commit
9aac6e02
authored
Jul 08, 2008
by
Quanah Gibson-Mount
Browse files
added support for deleting attribute type from the list of attributes
parent
131bc0f4
Changes
4
Hide whitespace changes
Inline
Side-by-side
contrib/ldapc++/src/LDAPAttributeList.cpp
View file @
9aac6e02
...
...
@@ -140,22 +140,30 @@ void LDAPAttributeList::addAttribute(const LDAPAttribute& attr){
}
}
void
LDAPAttributeList
::
replace
Attribute
(
const
LDAPAttribute
&
attr
)
void
LDAPAttributeList
::
del
Attribute
(
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
);
}
...
...
contrib/ldapc++/src/LDAPAttributeList.h
View file @
9aac6e02
...
...
@@ -90,6 +90,12 @@ class LDAPAttributeList{
* @param attr The attribute to add to the list.
*/
void
addAttribute
(
const
LDAPAttribute
&
attr
);
/**
* Deletes all values of an Attribute for the list
* @param type The attribute type to be deleted.
*/
void
delAttribute
(
const
std
::
string
&
type
);
/**
* Replace an Attribute in the List
...
...
contrib/ldapc++/src/LDAPEntry.cpp
View file @
9aac6e02
...
...
@@ -88,6 +88,11 @@ void LDAPEntry::addAttribute(const LDAPAttribute& attr)
m_attrs
->
addAttribute
(
attr
);
}
void
LDAPEntry
::
delAttribute
(
const
std
::
string
&
type
)
{
m_attrs
->
delAttribute
(
type
);
}
void
LDAPEntry
::
replaceAttribute
(
const
LDAPAttribute
&
attr
)
{
m_attrs
->
replaceAttribute
(
attr
);
...
...
contrib/ldapc++/src/LDAPEntry.h
View file @
9aac6e02
...
...
@@ -78,6 +78,13 @@ class LDAPEntry{
* @param attr The attribute to add to the list.
*/
void
addAttribute
(
const
LDAPAttribute
&
attr
);
/**
* Deletes all values of an Attribute from the list of Attributes
* (simple wrapper around LDAPAttributeList::delAttribute() ).
* @param type The attribute to delete.
*/
void
delAttribute
(
const
std
::
string
&
type
);
/**
* Replace an Attribute in the List of Attributes (simple wrapper
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment