From 9b3189193849d3179750ab82664fa188b2934458 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 13 Oct 2005 20:57:15 +0000 Subject: [PATCH] Added removeAllFields() for a field name. --- src/header.cpp | 9 +++++++++ vmime/header.hpp | 4 ++++ 2 files changed, 13 insertions(+) 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 > 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