#include <rs-config.h>
Public Member Functions | |
config_file () | |
config_file (std::string filename) | |
bool | contains (const char *key) const |
std::string | get (const char *key, const char *def) const |
config_value | get (const char *key) const |
template<class T > | |
T | get_or_default (const char *key, T def) const |
config_file & | operator= (const config_file &other) |
bool | operator== (const config_file &other) const |
void | reset () |
void | save (const char *filename) |
void | set (const char *key, const char *value) |
template<class T > | |
void | set (const char *key, T val) |
void | set_default (const char *key, const char *calculate) |
template<class T > | |
void | set_default (const char *key, T val) |
Static Public Member Functions | |
static config_file & | instance () |
Private Member Functions | |
std::string | get_default (const char *key, const char *def) const |
void | save () |
Private Attributes | |
std::map< std::string, std::string > | _defaults |
std::string | _filename |
std::map< std::string, std::string > | _values |
Definition at line 39 of file rs-config.h.
config_file::config_file | ( | ) |
Definition at line 114 of file rs-config.cpp.
config_file::config_file | ( | std::string | filename | ) |
Definition at line 87 of file rs-config.cpp.
bool config_file::contains | ( | const char * | key | ) | const |
Definition at line 42 of file rs-config.cpp.
std::string config_file::get | ( | const char * | key, |
const char * | def | ||
) | const |
Definition at line 32 of file rs-config.cpp.
config_value config_file::get | ( | const char * | key | ) | const |
Definition at line 55 of file rs-config.cpp.
|
private |
Definition at line 48 of file rs-config.cpp.
|
inline |
Definition at line 65 of file rs-config.h.
|
static |
Definition at line 80 of file rs-config.cpp.
config_file & config_file::operator= | ( | const config_file & | other | ) |
Definition at line 119 of file rs-config.cpp.
bool config_file::operator== | ( | const config_file & | other | ) | const |
Definition at line 130 of file rs-config.cpp.
Definition at line 26 of file rs-config.cpp.
void config_file::save | ( | const char * | filename | ) |
Definition at line 61 of file rs-config.cpp.
|
private |
Definition at line 109 of file rs-config.cpp.
void config_file::set | ( | const char * | key, |
const char * | value | ||
) |
Definition at line 15 of file rs-config.cpp.
|
inline |
Definition at line 72 of file rs-config.h.
void config_file::set_default | ( | const char * | key, |
const char * | calculate | ||
) |
Definition at line 21 of file rs-config.cpp.
|
inline |
Definition at line 48 of file rs-config.h.
|
private |
Definition at line 93 of file rs-config.h.
|
private |
Definition at line 94 of file rs-config.h.
|
private |
Definition at line 92 of file rs-config.h.