![]() |
nomlib
|
JSON Configuration file interface. More...
#include <JsonConfigFile.hpp>
Public Types | |
| typedef JsonConfigFile | self_type |
| typedef self_type * | raw_ptr |
| typedef std::unique_ptr< self_type > | unique_ptr |
| typedef std::shared_ptr< self_type > | shared_ptr |
| Public Types inherited from nom::IConfigFile | |
| typedef IConfigFile | self_type |
| typedef self_type * | raw_ptr |
| typedef std::unique_ptr< self_type > | unique_ptr |
| typedef std::shared_ptr< self_type > | shared_ptr |
| typedef std::pair< std::string, Value > | Pair |
| typedef std::map< std::string, Value > | value_type |
Public Member Functions | |
| JsonConfigFile (void) | |
| Default constructor; initialize the loader and saver interfaces necessary for JSON I/O. | |
| ~JsonConfigFile (void) | |
| Destructor. | |
| bool | flush (void) |
| Re-implements IConfigFile::flush. | |
| IValueDeserializer * | deserializer (void) const |
| Re-implements IConfigFile::deserializer. | |
| IValueSerializer * | serializer (void) const |
| Re-implements IConfigFile::serializer. | |
| bool | load (void) |
| Re-implements IConfigFile::load. | |
| bool | save (void) |
| Re-implements IConfigFile::save. | |
| Public Member Functions inherited from nom::IConfigFile | |
| IConfigFile (void) | |
| Default constructor. | |
| virtual | ~IConfigFile (void) |
| Destructor. | |
| 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. | |
Private Member Functions | |
| bool | initialize (void) |
| Internal helper method for initializing the object state. | |
| void | set_deserializer (IValueDeserializer *fp) |
| Set the configuration loader. | |
| void | set_serializer (IValueSerializer *fp) |
| Set the configuration saver. | |
Private Attributes | |
| std::unique_ptr< IValueDeserializer > | deserializer_ |
| Object pointer to an object deriving from nom::IValueDeserializer. | |
| std::unique_ptr< IValueSerializer > | serializer_ |
| Object pointer to an object deriving from nom::IValueSerializer. | |
JSON Configuration file interface.
Definition at line 45 of file JsonConfigFile.hpp.
| typedef self_type* nom::JsonConfigFile::raw_ptr |
Definition at line 50 of file JsonConfigFile.hpp.
| typedef JsonConfigFile nom::JsonConfigFile::self_type |
Definition at line 48 of file JsonConfigFile.hpp.
| typedef std::shared_ptr<self_type> nom::JsonConfigFile::shared_ptr |
Definition at line 52 of file JsonConfigFile.hpp.
| typedef std::unique_ptr<self_type> nom::JsonConfigFile::unique_ptr |
Definition at line 51 of file JsonConfigFile.hpp.
|
virtual |
Re-implements IConfigFile::deserializer.
Implements nom::IConfigFile.
|
virtual |
Re-implements IConfigFile::flush.
Implements nom::IConfigFile.
|
virtual |
Re-implements IConfigFile::load.
Implements nom::IConfigFile.
|
virtual |
Re-implements IConfigFile::save.
Implements nom::IConfigFile.
|
virtual |
Re-implements IConfigFile::serializer.
Implements nom::IConfigFile.
|
private |
Set the configuration loader.
| fp | An object deriving from nom::IValueDeserializer. |
|
private |
Set the configuration saver.
| fp | An object deriving from nom::IValueSerializer. |
|
private |
Object pointer to an object deriving from nom::IValueDeserializer.
Definition at line 99 of file JsonConfigFile.hpp.
|
private |
Object pointer to an object deriving from nom::IValueSerializer.
Definition at line 102 of file JsonConfigFile.hpp.