#include <config.hpp>
The name is slightly unusual, but it was chosen so the static functions sound natural, e.g. global_config::override()
.
Definition at line 157 of file config.hpp.
Static Public Member Functions | |
static const config_record & | get_config () |
Returns a reference to the global config record that contains entries for all config variables. | |
static void | override_with (const config_record &) |
Override the global config vars with the data in the given config record. | |
static void | save (const gsgl::string &fname) |
Save the global config to a file. | |
Protected Member Functions | |
virtual void | assign_from_string (const gsgl::string &)=0 |
Change the value of the config variable based on a given string. | |
virtual gsgl::string | get_string () const =0 |
Get a string representation of the value of the variable. | |
global_config (const gsgl::string &path) | |
virtual | ~global_config () |
Protected Attributes | |
config_record & | associated_record |
Static Protected Attributes | |
static config_record | global_config_vars |
global_config | ( | const gsgl::string & | path | ) | [protected] |
Definition at line 656 of file config.cpp.
References assert, global_config::associated_record, and config_record::associated_var.
~global_config | ( | ) | [protected, virtual] |
Definition at line 664 of file config.cpp.
virtual void assign_from_string | ( | const gsgl::string & | ) | [protected, pure virtual] |
Change the value of the config variable based on a given string.
Implemented in config_variable, config_variable< float >, config_variable< gsgl::string >, config_variable< int >, config_variable< gsgl::platform::color >, config_variable, config_variable, config_variable, and config_variable.
Referenced by config_record::override_with().
static const config_record& get_config | ( | ) | [inline, static] |
Returns a reference to the global config record that contains entries for all config variables.
Note that not all entries may be present if package DLLs have not yet been loaded.
Definition at line 174 of file config.hpp.
Referenced by application::application(), and application::get_config_overrides().
virtual gsgl::string get_string | ( | ) | const [protected, pure virtual] |
Get a string representation of the value of the variable.
Implemented in config_variable, config_variable< float >, config_variable< gsgl::string >, config_variable< int >, config_variable< gsgl::platform::color >, config_variable, config_variable, config_variable, and config_variable.
void override_with | ( | const config_record & | cr | ) | [static] |
Override the global config vars with the data in the given config record.
Definition at line 671 of file config.cpp.
References global_config::global_config_vars, and config_record::override_with().
Referenced by application::get_config_overrides().
void save | ( | const gsgl::string & | fname | ) | [static] |
Save the global config to a file.
Definition at line 677 of file config.cpp.
References global_config::global_config_vars, config_record::override_with(), and config_record::save().
Referenced by application::get_config_overrides().
config_record& associated_record [protected] |
Definition at line 163 of file config.hpp.
Referenced by config_variable< gsgl::platform::color >::config_variable(), and global_config::global_config().
config_record global_config_vars [static, protected] |
Definition at line 162 of file config.hpp.
Referenced by global_config::override_with(), and global_config::save().