aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-10-13 20:57:15 +0000
committerVincent Richard <[email protected]>2005-10-13 20:57:15 +0000
commit9b3189193849d3179750ab82664fa188b2934458 (patch)
tree7bc345c5275efc61a9d492026c10813dd5a81716
parentAdded getPart() and getHeader() on attachment. (diff)
downloadvmime-9b3189193849d3179750ab82664fa188b2934458.tar.gz
vmime-9b3189193849d3179750ab82664fa188b2934458.zip
Added removeAllFields() for a field name.
-rw-r--r--src/header.cpp9
-rw-r--r--vmime/header.hpp4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/header.cpp b/src/header.cpp
index 0d0a2154..503ee16b 100644
--- a/src/header.cpp
+++ b/src/header.cpp
@@ -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());
diff --git a/vmime/header.hpp b/vmime/header.hpp
index 09ab59c9..e7a834df 100644
--- a/vmime/header.hpp
+++ b/vmime/header.hpp
@@ -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