Parameter set. More...
#include <dashel.h>
Public Member Functions | |
void | add (const char *line) |
Add values to set. | |
void | addParam (const char *param, const char *value=NULL, bool atStart=false) |
Add a parameter to a set. | |
void | erase (const char *key) |
Erase the parameter from the set. | |
template<typename T > | |
T | get (const char *key) const |
Get a parameter value. | |
const std::string & | get (const char *key) const |
Get a parameter value. | |
std::string | getString () const |
Get the parameters as string. | |
bool | isSet (const char *key) const |
Return whether a key is set or not. | |
Private Attributes | |
std::vector< std::string > | params |
std::map< std::string, std::string > | values |
void Dashel::ParameterSet::add | ( | const char * | line | ) |
Add values to set.
Definition at line 191 of file dashel-common.cpp.
void Dashel::ParameterSet::addParam | ( | const char * | param, |
const char * | value = NULL , |
||
bool | atStart = false |
||
) |
Add a parameter to a set.
param | name of the parameter |
value | value of the parameter or NULL (then parameter will default or pre-existing value) |
atStart | if true, insert parameter at start of the list |
Definition at line 224 of file dashel-common.cpp.
void Dashel::ParameterSet::erase | ( | const char * | key | ) |
Erase the parameter from the set.
Definition at line 265 of file dashel-common.cpp.
T Dashel::ParameterSet::get | ( | const char * | key | ) | const |
Get a parameter value.
Definition at line 240 of file dashel-common.cpp.
const std::string& Dashel::ParameterSet::get | ( | const char * | key | ) | const |
Get a parameter value.
std::string Dashel::ParameterSet::getString | ( | ) | const |
Get the parameters as string.
Definition at line 251 of file dashel-common.cpp.
bool Dashel::ParameterSet::isSet | ( | const char * | key | ) | const |
Return whether a key is set or not.
Definition at line 235 of file dashel-common.cpp.
std::vector<std::string> Dashel::ParameterSet::params [private] |
std::map<std::string, std::string> Dashel::ParameterSet::values [private] |