#include <paramfile.h>
Public Member Functions | |
paramfile (const std::string &filename, bool verbose_=true) | |
paramfile (const params_type &par, bool verbose_=true) | |
void | setVerbosity (bool verbose_) |
bool | getVerbosity () const |
bool | param_present (const std::string &key) const |
template<typename T> | |
T | find (const std::string &key) const |
template<typename T> | |
T | find (const std::string &key, const T &deflt) |
const params_type & | getParams () const |
template<typename T> | |
void | setParam (const std::string &key, const T &value) |
Definition at line 44 of file paramfile.h.
paramfile::paramfile | ( | const std::string & | filename, | |
bool | verbose_ = true | |||
) |
Constructs a paramfile object from the contents of filename. If verbose_==true, diagnostic output is generated when calling methods on this object, otherwise not.
paramfile::paramfile | ( | const params_type & | par, | |
bool | verbose_ = true | |||
) |
Constructs a paramfile object from the contents of par. If verbose_==true, diagnostic output is generated when calling methods on this object, otherwise not.
Definition at line 52 of file paramfile.cc.
void paramfile::setVerbosity | ( | bool | verbose_ | ) | [inline] |
Allows adjusting the verbosity.
Definition at line 71 of file paramfile.h.
bool paramfile::getVerbosity | ( | ) | const [inline] |
Returns the verbosity setting of the object.
Definition at line 75 of file paramfile.h.
bool paramfile::param_present | ( | const std::string & | key | ) | const |
Returns true
, if a paremeter called key is stored in the object, else false
.
T paramfile::find | ( | const std::string & | key | ) | const [inline] |
Returns the value stored for the parameter name key, after converting it to the requested type. If key is not present, an exception is thrown.
T paramfile::find | ( | const std::string & | key, | |
const T & | deflt | |||
) | [inline] |
Returns the value stored for the parameter name key, after converting it to the requested type. If key is not present, deflt is returned instead, and is also entered into the parameter set.
const params_type& paramfile::getParams | ( | ) | const [inline] |
Returns the entire set of currently stored parameters.
Definition at line 93 of file paramfile.h.
void paramfile::setParam | ( | const std::string & | key, | |
const T & | value | |||
) | [inline] |
Sets the parameter with the name key to value.
Definition at line 97 of file paramfile.h.