#include <icy/collection.h>Subclassed by:
FormWriter,Message
A storage container for a name value collections. This collection can store multiple entries for each name, and it's getters are case-insensitive.
| Return | Name | Description |
|---|---|---|
NVCollection inline | ||
NVCollection inline | ||
NVCollection inline | ||
NVCollection & | operator= | Assigns the name-value pairs of another NVCollection to this one. |
const std::string & | operator[] const | Returns the value of the (first) name-value pair with the given name. |
void | set | Sets the value of the (first) name-value pair with the given name. |
void | add | Adds a new name-value pair with the given name and value. |
void | add | Adds a new name-value pair using move semantics. |
const std::string & | get const | Returns the value of the first name-value pair with the given name. |
const std::string & | get const | Returns the value of the first name-value pair with the given name. If no value with the given name has been found, the defaultValue is returned. |
bool | has const | Returns true if there is at least one name-value pair with the given name. |
ConstIterator | find const | Returns an iterator pointing to the first name-value pair with the given name. |
ConstIterator | begin const | Returns an iterator pointing to the begin of the name-value pair collection. |
ConstIterator | end const | Returns an iterator pointing to the end of the name-value pair collection. |
bool | empty const | Returns true iff the header does not have any content. |
int | size const | Returns the number of name-value pairs in the collection. |
void | erase | Removes all name-value pairs with the given name. |
void | clear | Removes all name-value pairs and their values. |
inline
inline NVCollection()inline
inline NVCollection(const NVCollection & nvc)inline
inline NVCollection(NVCollection && nvc) noexceptNVCollection & operator=(const NVCollection & nvc)Assigns the name-value pairs of another NVCollection to this one.
const
const std::string & operator[](std::string_view name) constReturns the value of the (first) name-value pair with the given name.
Throws a NotFoundException if the name-value pair does not exist.
void set(const std::string & name, const std::string & value)Sets the value of the (first) name-value pair with the given name.
void add(const std::string & name, const std::string & value)Adds a new name-value pair with the given name and value.
void add(std::string && name, std::string && value)Adds a new name-value pair using move semantics.
const
const std::string & get(std::string_view name) constReturns the value of the first name-value pair with the given name.
Throws a NotFoundException if the name-value pair does not exist.
const
const std::string & get(std::string_view name, const std::string & defaultValue) constReturns the value of the first name-value pair with the given name. If no value with the given name has been found, the defaultValue is returned.
const
bool has(std::string_view name) constReturns true if there is at least one name-value pair with the given name.
const
ConstIterator find(std::string_view name) constReturns an iterator pointing to the first name-value pair with the given name.
const
ConstIterator begin() constReturns an iterator pointing to the begin of the name-value pair collection.
const
ConstIterator end() constReturns an iterator pointing to the end of the name-value pair collection.
const
bool empty() constReturns true iff the header does not have any content.
const
int size() constReturns the number of name-value pairs in the collection.
void erase(std::string_view name)Removes all name-value pairs with the given name.
void clear()Removes all name-value pairs and their values.
| Name | Description |
|---|---|
Map | |
Iterator | |
ConstIterator |
std::vector< std::pair< std::string, std::string > > Map()Map::iterator Iterator()Map::const_iterator ConstIterator()| Return | Name | Description |
|---|---|---|
Map | _map |
Map _map