From f3d249c81b6395550fe81c31da9a63b9146810cf Mon Sep 17 00:00:00 2001 From: Laurent Richard Date: Wed, 6 Oct 2004 11:04:00 +0000 Subject: Adding functions in 'header' object to retrieve a list of fields by name/type --- src/header.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/header.hpp') diff --git a/src/header.hpp b/src/header.hpp index 8ce070b9..b675e6fc 100644 --- a/src/header.hpp +++ b/src/header.hpp @@ -56,13 +56,11 @@ class header : public component friend class body; friend class message; -protected: +public: header(); ~header(); -public: - // A sub-class for field manipulation class fieldsContainer { @@ -125,6 +123,11 @@ public: headerField& find(const headerField::Types fieldType) const; headerField& find(const string& fieldName) const; + // Find all fields that matche the specified type/name. + // If no field is found, an empty vector is returned. + std::vector findAllByType(const headerField::Types fieldType); + std::vector findAllByName(const string& fieldName); + // Find the first field that matches the specified type/name. // If no field is found, one will be created. headerField& get(const headerField::Types fieldType); -- cgit v1.2.3