class PFHeader

A header is list of <name>: <value> strings, delimited with \r\n sequences.

Methods:

void addField(const std::string& fieldName, const std::string& fieldValue, bool start = false)
Add new field. fieldName - Name fieldValue - Value start - true, if the field must be added to the list head
unsigned int removeFields(const std::string& fieldName, bool exact)
Removes the fields with specified name and returns the number of deleted items. fieldName - Name of the fields to remove exact - Set to false to remove the fields with names that start from fieldName.
std::vector<PFHeaderField*> getFields()
Returns all fields as an array.
PFHeaderField* findFirstField(const std::string& fieldName)
Returns a field with specified name, or NULL if it doesn't exist.
std::vector<PFHeaderField*> findFields(const std::string& fieldName, bool exact)
Returns the fields with specified name as an array. fieldName - Field name exact - Set to false to find the fields with names that start from fieldName.
unsigned int countFields(const std::string& fieldName)
Returns the number of fields with specified name.
unsigned int size()
Returns the number of fields in header.
PFHeaderField* getField(int index)
Returns a field by its index.
void clear()
Removes all fields from header.
bool empty()
Returns true if the header doesn't contain fields.

Requirements

Header PFHeader.h
Library ProtocolFilters.lib