|
cxcparamx-2.0
2.0.3
|
#include <cxcparamx/simple.h>
Public Types | |
| using | pParamFileImpl = std::unique_ptr< ParamFileImpl, void(*)(ParamFileImpl *)> |
Public Member Functions | |
| simple (int argc, char **argv, const string &mode="rw") | |
| Constructor with file name taken from argv[0]. More... | |
| simple (const string &filename, int argc, char **argv, const string &mode="rw") | |
| Constructor with explicit parameter file name. More... | |
| void | get (const string &name, float &value) const |
| Retrieve a parameter value into a float. More... | |
| void | get (const string &name, double &value) const |
| Retrieve a parameter value into a double. More... | |
| void | get (const string &name, short &value) const |
| Retrieve a parameter value into a short. More... | |
| void | get (const string &name, int &value) const |
| Retrieve a parameter value into an int. More... | |
| void | get (const string &name, long &value) const |
| Retrieve a parameter value into a long. More... | |
| void | get (const string &name, bool &value) const |
| Retrieve a parameter value into an bool. More... | |
| void | get (const string &name, string &value) const |
| Retrieve a parameter value into an string. More... | |
| float | getf (const string &name) const |
| Return a parameter value as a float. More... | |
| double | getd (const string &name) const |
| Return a parameter value as a double. More... | |
| short | gets (const string &name) const |
| Return a parameter value as a short. More... | |
| int | geti (const string &name) const |
| Return a parameter value as an int. More... | |
| long | getl (const string &name) const |
| Return a parameter value as a long. More... | |
| bool | getb (const string &name) const |
| Return a parameter value as an bool. More... | |
| string | getstr (const string &name) const |
| Return a parameter value as an string. More... | |
| bool | access (const string &name) const |
A simple wrapper class providing polymorphic attribute retrieval.
Instantiating the class opens the parameter file; the file is closed during object destruction.
| cxcparamx::simple::simple | ( | int | argc, |
| char ** | argv, | ||
| const string & | mode = "rw" |
||
| ) |
Constructor with file name taken from argv[0].
| [in] | argc | the number of elements in argv |
| [in] | argv | typically, the command line arguments vector passed to main* |
| [in] | mode | mode with which to open the file |
| cxcparamx::simple::simple | ( | const string & | in_filename, |
| int | argc, | ||
| char ** | argv, | ||
| const string & | mode = "rw" |
||
| ) |
Constructor with explicit parameter file name.
| [in] | filename | the parameter file name |
| [in] | argc | the number of elements in argv |
| argv | typically, the command line arguments vector passed to main | |
| [in] | mode | mode with which to open the file |
| void cxcparamx::simple::get | ( | const string & | name, |
| float & | value | ||
| ) | const |
Retrieve a parameter value into a float.
| [in] | name | parameter name |
| [out] | value | returned value |
| Exception | if parameter is not found |
| void cxcparamx::simple::get | ( | const string & | name, |
| double & | value | ||
| ) | const |
Retrieve a parameter value into a double.
| [in] | name | parameter name |
| [out] | value | returned value |
| Exception | if parameter is not found |
| void cxcparamx::simple::get | ( | const string & | name, |
| short & | value | ||
| ) | const |
Retrieve a parameter value into a short.
| [in] | name | parameter name |
| [out] | value | returned value |
| Exception | if parameter is not found |
| void cxcparamx::simple::get | ( | const string & | name, |
| int & | value | ||
| ) | const |
Retrieve a parameter value into an int.
| [in] | name | parameter name |
| [out] | value | returned value |
| Exception | if parameter is not found |
| void cxcparamx::simple::get | ( | const string & | name, |
| long & | value | ||
| ) | const |
Retrieve a parameter value into a long.
| [in] | name | parameter name |
| [out] | value | returned value |
| Exception | if parameter is not found |
| void cxcparamx::simple::get | ( | const string & | name, |
| bool & | value | ||
| ) | const |
Retrieve a parameter value into an bool.
| [in] | name | parameter name |
| [out] | value | returned value |
| Exception | if parameter is not found |
| void cxcparamx::simple::get | ( | const string & | name, |
| string & | value | ||
| ) | const |
Retrieve a parameter value into an string.
| [in] | name | parameter name |
| [out] | value | returned value |
| Exception | if parameter is not found |
| bool cxcparamx::simple::getb | ( | const string & | name | ) | const |
Return a parameter value as an bool.
| [in] | name | parameter name |
| Exception | if parameter is not found |
| double cxcparamx::simple::getd | ( | const string & | name | ) | const |
Return a parameter value as a double.
| [in] | name | parameter name |
| Exception | if parameter is not found |
| float cxcparamx::simple::getf | ( | const string & | name | ) | const |
Return a parameter value as a float.
| [in] | name | parameter name |
| Exception | if parameter is not found |
| int cxcparamx::simple::geti | ( | const string & | name | ) | const |
Return a parameter value as an int.
| [in] | name | parameter name |
| Exception | if parameter is not found |
| long cxcparamx::simple::getl | ( | const string & | name | ) | const |
Return a parameter value as a long.
| [in] | name | parameter name |
| Exception | if parameter is not found |
| short cxcparamx::simple::gets | ( | const string & | name | ) | const |
Return a parameter value as a short.
| [in] | name | parameter name |
| Exception | if parameter is not found |
| string cxcparamx::simple::getstr | ( | const string & | name | ) | const |
Return a parameter value as an string.
| [in] | name | parameter name |
| Exception | if parameter is not found |