PFHeader

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

void addField(const std::string &fieldName, const std::string &fieldValue, bool start = false)
Parameters:
  • fieldName – Field name

  • fieldValue – Field value

  • start – true, if the field must be added to the list head

Description:

Add a new field.

unsigned int removeFields(const std::string &fieldName, bool exact)
Parameters:
  • fieldName – Name of the fields to remove

  • exact – Set to false to remove the fields with names that start from fieldName.

Description:

Removes the fields with specified name and returns the number of deleted items.

std::vector<PFHeaderField*> getFields()
Description:

Returns all fields as an array.

PFHeaderField *findFirstField(const std::string &fieldName)
Description:

Returns a field with specified name, or NULL if it doesn’t exist.

std::vector<PFHeaderField*> findFields(const std::string &fieldName, bool exact)
Parameters:
  • fieldName – Field name

  • exact – Set to false to find the fields with names that start from fieldName.

Description:

Returns the fields with specified name as an array.

unsigned int countFields(const std::string &fieldName)
Description:

Returns the number of fields with specified name.

unsigned int size()
Description:

Returns the number of fields in header.

PFHeaderField *getField(int index)
Description:

Returns a field by its index.

void clear()
Description:

Removes all fields from header.

bool empty()
Description:

Returns true if the header doesn’t contain fields.