NVCollection
NVCollection
#include <icy/collection.h>class NVCollectionDefined in src/base/include/icy/collection.h:187
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.
List of all members
| Name | Kind | Owner |
|---|---|---|
NVCollection | function | Declared here |
NVCollection | function | Declared here |
NVCollection | function | Declared here |
~NVCollection | function | Declared here |
operator= | function | Declared here |
operator= | function | Declared here |
operator[] | function | Declared here |
set | function | Declared here |
add | function | Declared here |
add | function | Declared here |
get | function | Declared here |
get | function | Declared here |
has | function | Declared here |
find | function | Declared here |
begin | function | Declared here |
end | function | Declared here |
empty | function | Declared here |
size | function | Declared here |
erase | function | Declared here |
clear | function | Declared here |
Map | typedef | Declared here |
Iterator | typedef | Declared here |
ConstIterator | typedef | Declared here |
_map | variable | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
NVCollection inline | ||
NVCollection inline | ||
NVCollection inline noexcept | ||
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. |
NVCollection
inline
inline NVCollection()Defined in src/base/include/icy/collection.h:194
NVCollection
inline
inline NVCollection(const NVCollection & nvc)Defined in src/base/include/icy/collection.h:198
NVCollection
inline noexcept
inline NVCollection(NVCollection && nvc) noexceptDefined in src/base/include/icy/collection.h:203
operator=
NVCollection & operator=(const NVCollection & nvc)Defined in src/base/include/icy/collection.h:213
Assigns the name-value pairs of another NVCollection to this one.
operator[]
const
const std::string & operator[](std::string_view name) constDefined in src/base/include/icy/collection.h:219
Returns the value of the (first) name-value pair with the given name.
Throws a NotFoundException if the name-value pair does not exist.
set
void set(const std::string & name, const std::string & value)Defined in src/base/include/icy/collection.h:222
Sets the value of the (first) name-value pair with the given name.
add
void add(const std::string & name, const std::string & value)Defined in src/base/include/icy/collection.h:225
Adds a new name-value pair with the given name and value.
add
void add(std::string && name, std::string && value)Defined in src/base/include/icy/collection.h:228
Adds a new name-value pair using move semantics.
get
const
const std::string & get(std::string_view name) constDefined in src/base/include/icy/collection.h:233
Returns the value of the first name-value pair with the given name.
Throws a NotFoundException if the name-value pair does not exist.
get
const
const std::string & get(std::string_view name, const std::string & defaultValue) constDefined in src/base/include/icy/collection.h:238
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.
has
const
bool has(std::string_view name) constDefined in src/base/include/icy/collection.h:242
Returns true if there is at least one name-value pair with the given name.
find
const
ConstIterator find(std::string_view name) constDefined in src/base/include/icy/collection.h:246
Returns an iterator pointing to the first name-value pair with the given name.
begin
const
ConstIterator begin() constDefined in src/base/include/icy/collection.h:250
Returns an iterator pointing to the begin of the name-value pair collection.
end
const
ConstIterator end() constDefined in src/base/include/icy/collection.h:254
Returns an iterator pointing to the end of the name-value pair collection.
empty
const
bool empty() constDefined in src/base/include/icy/collection.h:257
Returns true iff the header does not have any content.
size
const
int size() constDefined in src/base/include/icy/collection.h:261
Returns the number of name-value pairs in the collection.
erase
void erase(std::string_view name)Defined in src/base/include/icy/collection.h:264
Removes all name-value pairs with the given name.
clear
void clear()Defined in src/base/include/icy/collection.h:267
Removes all name-value pairs and their values.
Public Types
| Name | Description |
|---|---|
Map | |
Iterator | |
ConstIterator |
Map
using Map = std::vector< std::pair< std::string, std::string > >Defined in src/base/include/icy/collection.h:190
Iterator
using Iterator = Map::iteratorDefined in src/base/include/icy/collection.h:191
ConstIterator
using ConstIterator = Map::const_iteratorDefined in src/base/include/icy/collection.h:192
Private Attributes
| Return | Name | Description |
|---|---|---|
Map | _map |
_map
Map _map