Image Component Library (ICL)
|
Utility structure that utilizes an std::map as parameter list. More...
#include <ParamList.h>
Inherits std::map< K, T >.
Public Types | |
typedef std::string | Key |
The Key type (std::string) | |
typedef Any | Value |
The Value type (icl::Any) | |
Public Member Functions | |
ParamList () | |
creates an empty param list instance | |
ParamList (const std::string &commaSepKeyValueString) throw (ICLException) | |
creates a param list from a single given string | |
ParamList (const char *commaSepKeyValueString) throw (ICLException) | |
this allows for implicit creation of a ParamList instance from a given const char * | |
void | init (const std::string commaSepKeyValueString) throw (ICLException) |
ParamList (const Key &key0, const Value &value0, const Key &key1="", const Value &value1="", const Key &key2="", const Value &value2="", const Key &key3="", const Value &value3="", const Key &key4="", const Value &value4="", const Key &key5="", const Value &value5="", const Key &key6="", const Value &value6="", const Key &key7="", const Value &value7="", const Key &key8="", const Value &value8="", const Key &key9="", const Value &value9="") | |
Constructor, that can get up to 10 key-value pairs. | |
bool | hasKey (const Key &key) const |
returns whether the map contains the given key | |
void | removeKey (const Key &key) |
removes the given key from the map | |
const Any & | operator[] (const Key &key) const throw (ICLException) |
extension for the unconst operator that is provided by the std::map class |
Utility structure that utilizes an std::map as parameter list.
The ParamList is supposed to be used in function interfaces for passing several parameters as one argument. Usually this should only be used where efficiency is not compulsory
typedef std::string icl::utils::ParamList::Key |
The Key type (std::string)
typedef Any icl::utils::ParamList::Value |
The Value type (icl::Any)
icl::utils::ParamList::ParamList | ( | ) | [inline] |
creates an empty param list instance
icl::utils::ParamList::ParamList | ( | const std::string & | commaSepKeyValueString | ) | throw (ICLException) [inline] |
creates a param list from a single given string
The string is a comma seperated list of key=value tokens. Both comma and the '='-character can be escaped using backslash
icl::utils::ParamList::ParamList | ( | const char * | commaSepKeyValueString | ) | throw (ICLException) [inline] |
this allows for implicit creation of a ParamList instance from a given const char *
icl::utils::ParamList::ParamList | ( | const Key & | key0, |
const Value & | value0, | ||
const Key & | key1 = "" , |
||
const Value & | value1 = "" , |
||
const Key & | key2 = "" , |
||
const Value & | value2 = "" , |
||
const Key & | key3 = "" , |
||
const Value & | value3 = "" , |
||
const Key & | key4 = "" , |
||
const Value & | value4 = "" , |
||
const Key & | key5 = "" , |
||
const Value & | value5 = "" , |
||
const Key & | key6 = "" , |
||
const Value & | value6 = "" , |
||
const Key & | key7 = "" , |
||
const Value & | value7 = "" , |
||
const Key & | key8 = "" , |
||
const Value & | value8 = "" , |
||
const Key & | key9 = "" , |
||
const Value & | value9 = "" |
||
) | [inline] |
Constructor, that can get up to 10 key-value pairs.
zero-length keys are skipped!
bool icl::utils::ParamList::hasKey | ( | const Key & | key | ) | const [inline] |
returns whether the map contains the given key
This is just a shortcut to the find()-method that is provided by the std::map
void icl::utils::ParamList::init | ( | const std::string | commaSepKeyValueString | ) | throw (ICLException) [inline] |
const Any& icl::utils::ParamList::operator[] | ( | const Key & | key | ) | const throw (ICLException) [inline] |
extension for the unconst operator that is provided by the std::map class
void icl::utils::ParamList::removeKey | ( | const Key & | key | ) | [inline] |
removes the given key from the map
This is just a shortcut to the find()-method that is provided by the std::map