Added removeAllFields() for a field name.

This commit is contained in:
Vincent Richard 2005-10-13 20:57:15 +00:00
parent b9471c9543
commit 9b31891938
2 changed files with 13 additions and 0 deletions

View File

@ -295,6 +295,15 @@ void header::removeAllFields()
}
void header::removeAllFields(const string& fieldName)
{
std::vector <ref <headerField> > fields = findAllFields(fieldName);
for (unsigned int i = 0 ; i < fields.size() ; ++i)
removeField(fields[i]);
}
const int header::getFieldCount() const
{
return (m_fields.size());

View File

@ -181,6 +181,10 @@ public:
*/
void removeAllFields();
/** Remove all fields with the specified name.
*/
void removeAllFields(const string& fieldName);
/** Return the number of fields in the list.
*
* @return number of fields