#include <simple_config.hpp>
Public Types | |
typedef ::s11nlite::node_type | node_type |
typedef ::s11nlite::node_traits | node_traits |
Public Member Functions | |
simple_config (const std::string &basename) throw (std::runtime_error) | |
Constructs a config object associated with the file $HOME/.basename.s11n. | |
~simple_config () throw () | |
Attempts to save this object's node() to this->abs_path(). | |
std::string | abs_path () const |
Absolute path to this object's file. | |
std::string | basename () const |
Base filename passed to the ctor. | |
node_type & | node () |
This object's data node, which can be used to store any s11nlite-serializable data. |
Definition at line 17 of file simple_config.hpp.
Definition at line 20 of file simple_config.hpp.
Definition at line 21 of file simple_config.hpp.
s11nlite::simple_config::simple_config | ( | const std::string & | basename | ) | throw (std::runtime_error) [inline] |
Constructs a config object associated with the file $HOME/.basename.s11n.
If the file does not exist we assume we can create it. If $HOME cannot be resolved or basename has a '/' character in it an exception is thrown. basename should be a filename friendly string, such as "myapp", "My_App", or "My_App-1.0.3".
Definition at line 76 of file simple_config.hpp.
s11nlite::simple_config::~simple_config | ( | ) | throw () [inline] |
Attempts to save this object's node() to this->abs_path().
Definition at line 86 of file simple_config.hpp.
References CERR, and s11nlite::save().
std::string s11nlite::simple_config::abs_path | ( | ) | const [inline] |
std::string s11nlite::simple_config::basename | ( | ) | const [inline] |
node_type& s11nlite::simple_config::node | ( | ) | [inline] |
This object's data node, which can be used to store any s11nlite-serializable data.
Definition at line 123 of file simple_config.hpp.