Class to manage all of configuration read from and written to JSON file. More...
#include "Config.hpp"
Public Member Functions | |
Config (const std::string fn="") | |
Constructor. More... | |
~Config (void) | |
Destructor. More... | |
Config & | load (const std::string fn="/etc/myra-canyon.conf") |
Load configuration from file. More... | |
Config & | save (const std::string fn="") |
Save the JSON configuration to the named file. More... | |
Public Attributes | |
JSON | json |
Root (top level) of configuration. More... | |
std::string | filename |
Filename where configuration is stored. More... | |
Class to manage all of configuration read from and written to JSON file.
Myra::Config::Config | ( | const std::string | fn = "" | ) |
Constructor.
Myra::Config::~Config | ( | void | ) |
Destructor.
Myra::Config & Myra::Config::load | ( | const std::string | fn = "/etc/myra-canyon.conf" | ) |
Load configuration from file.
Myra::Config & Myra::Config::save | ( | const std::string | fn = "" | ) |
Save the JSON configuration to the named file.
If the filename is empty, then save to the original name from which it was initially loaded.
std::string Myra::Config::filename |
Filename where configuration is stored.
JSON Myra::Config::json |
Root (top level) of configuration.