BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Member Functions | Static Public Member Functions
BeeeOn::ConfigurationSaver Class Reference
Inheritance diagram for BeeeOn::ConfigurationSaver:
BeeeOn::Loggable

Public Member Functions

 ConfigurationSaver (const std::string &filePath)
 
Poco::AutoPtr
< Poco::Util::AbstractConfiguration > 
config () const
 
void save () const
 

Static Public Member Functions

static void saveAs (Poco::AutoPtr< Poco::Util::AbstractConfiguration > conf, const std::string &filePath)
 

Additional Inherited Members

- Protected Member Functions inherited from BeeeOn::Loggable
void setupLogger (Poco::Logger *logger=0) const
 
Poco::Logger & logger () const
 
 Loggable (const ClassInfo &info)
 
 Loggable (const std::type_info &info)
 
- Static Protected Member Functions inherited from BeeeOn::Loggable
static Poco::Logger & forMethod (const char *name)
 
static Poco::Logger & forClass (const ClassInfo &info)
 
static Poco::Logger & forClass (const std::type_info &info)
 
template<typename T >
static Poco::Logger & forInstance (const T *i)
 
static void configureSimple (Poco::Logger &logger, const std::string &level)
 
static void logException (Poco::Logger &logger, const Poco::Message::Priority priority, const Poco::Exception &e, const char *file, size_t line)
 

Member Function Documentation

void ConfigurationSaver::save ( ) const

Saves the m_config in the m_file. m_config is created in constructor based on m_file extension. Supported extensions: .xml, .json, .property

void ConfigurationSaver::saveAs ( Poco::AutoPtr< Poco::Util::AbstractConfiguration >  conf,
const std::string &  filePath 
)
static

Saves given configuration in file based on object type. It does not check the extension of given file name. Supported types of configuration: XML, JSON, PropertyFile.

Notice: in the case of XMLConfiguration can throw an exception caused by the fact, that XMLConfiguration method loadEmpty("root") was not called before "filling" the configuration. This issue is fixed in Poco commit 20a6f258, but this commit is not yet published.


The documentation for this class was generated from the following files: