Abstract base class for configuration file types.
More...
#include <IConfigFile.hpp>
|
|
| IConfigFile (void) |
| | Default constructor.
|
|
virtual | ~IConfigFile (void) |
| | Destructor.
|
| virtual IValueDeserializer * | deserializer (void) const =0 |
| virtual IValueSerializer * | serializer (void) const =0 |
| virtual bool | flush (void)=0 |
| | Force an output (save) of the current configuration.
|
| virtual bool | load (void)=0 |
| | Deserialize the configuration from the set file path.
|
| virtual bool | save (void)=0 |
| | Serialize the current configuration to the set file path.
|
| const std::string & | filename (void) const |
| | Obtain the set file path.
|
|
bool | exists (const std::string &key) const |
| | Check to see if an existing configuration key exists.
|
| int | get_int (const std::string &key, int default_value) const |
| uint | get_uint (const std::string &key, uint default_value) const |
| double | get_double (const std::string &key, double default_value) const |
| const std::string | get_string (const std::string &key, const std::string &default_value) const |
| bool | get_bool (const std::string &key, bool default_value) const |
| void | set_property (const std::string &key, const Value &value) |
| | Write a value to the configuration, mapped by key.
|
| bool | erase (const std::string &key) |
| | Destroy a configuration item.
|
| void | set_filename (const std::string &filename) |
| | Set the file I/O path.
|
|
|
const value_type & | get (void) const |
| | Internal getter method for the storage container.
|
|
| class | JsonConfigFile |
| | Access to our (private) get method; returns value_type container.
|
Abstract base class for configuration file types.
Definition at line 52 of file IConfigFile.hpp.
◆ Pair
| typedef std::pair<std::string, Value> nom::IConfigFile::Pair |
◆ raw_ptr
| typedef self_type* nom::IConfigFile::raw_ptr |
◆ self_type
◆ shared_ptr
| typedef std::shared_ptr<self_type> nom::IConfigFile::shared_ptr |
◆ unique_ptr
| typedef std::unique_ptr<self_type> nom::IConfigFile::unique_ptr |
◆ value_type
| typedef std::map<std::string, Value> nom::IConfigFile::value_type |
◆ deserializer()
◆ erase()
| bool nom::IConfigFile::erase |
( |
const std::string & | key | ) |
|
Destroy a configuration item.
- Parameters
-
| key | The configuration item, referenced by member key. |
◆ filename()
| const std::string & nom::IConfigFile::filename |
( |
void | | ) |
const |
Obtain the set file path.
◆ flush()
| virtual bool nom::IConfigFile::flush |
( |
void | | ) |
|
|
pure virtual |
◆ get_bool()
| bool nom::IConfigFile::get_bool |
( |
const std::string & | key, |
|
|
bool | default_value ) const |
- Returns
- The boolean value of the configuration key.
◆ get_double()
| double nom::IConfigFile::get_double |
( |
const std::string & | key, |
|
|
double | default_value ) const |
- Returns
- The double value of the configuration key.
◆ get_int()
| int nom::IConfigFile::get_int |
( |
const std::string & | key, |
|
|
int | default_value ) const |
- Returns
- The signed integer of the configuration key.
◆ get_string()
| const std::string nom::IConfigFile::get_string |
( |
const std::string & | key, |
|
|
const std::string & | default_value ) const |
- Returns
- The string of the configuration key.
◆ get_uint()
| uint nom::IConfigFile::get_uint |
( |
const std::string & | key, |
|
|
uint | default_value ) const |
- Returns
- The unsigned integer of the configuration key.
◆ load()
| virtual bool nom::IConfigFile::load |
( |
void | | ) |
|
|
pure virtual |
◆ save()
| virtual bool nom::IConfigFile::save |
( |
void | | ) |
|
|
pure virtual |
◆ serializer()
◆ set_filename()
| void nom::IConfigFile::set_filename |
( |
const std::string & | filename | ) |
|
◆ set_property()
| void nom::IConfigFile::set_property |
( |
const std::string & | key, |
|
|
const Value & | value ) |
Write a value to the configuration, mapped by key.
◆ JsonConfigFile
| friend class JsonConfigFile |
( |
void | | ) |
|
|
friend |
Access to our (private) get method; returns value_type container.
Definition at line 65 of file IConfigFile.hpp.
◆ config_
| value_type nom::IConfigFile::config_ |
|
private |
◆ filename_
| std::string nom::IConfigFile::filename_ |
|
private |
The documentation for this class was generated from the following file: