A list parameter can now be removed by pointer.

git-svn-id: http://yate.null.ro/svn/yate/trunk@3089 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2010-02-18 12:59:50 +00:00
parent f495fe5984
commit 2682cdb12e
2 changed files with 18 additions and 0 deletions

View File

@ -118,6 +118,18 @@ NamedList& NamedList::clearParam(const String& name, char childSep)
return *this;
}
// Remove a specific parameter
NamedList& NamedList::clearParam(NamedString* param)
{
if (!param)
return *this;
ObjList* o = m_params.find(param);
if (o)
o->remove();
XDebug(DebugInfo,"NamedList::clearParam(%p) found=%p",param,o);
return *this;
}
NamedList& NamedList::copyParam(const NamedList& original, const String& name, char childSep)
{
XDebug(DebugInfo,"NamedList::copyParam(%p,\"%s\",'%1s')",

View File

@ -3313,6 +3313,12 @@ public:
*/
NamedList& clearParam(const String& name, char childSep = 0);
/**
* Remove a specific parameter
* @param param Pointer to parameter to remove
*/
NamedList& clearParam(NamedString* param);
/**
* Copy a parameter from another NamedList, clears it if not present there
* @param original NamedList to copy the parameter from