The namespace 'config' contains routines for interacting with the global configuration file parser. More...
Enumerations | |
enum | SourceFormat { SOURCE_FORMAT_JSON , SOURCE_FORMAT_XML } |
Functions | |
bool | hasArraySupport (SourceFormat format) |
bool | hasRootSection (SourceFormat format) |
void | read (config::SourceFormat format, const std::string &content, bool append) |
void | read (const std::string &filename, bool append) |
void | reset () |
void | reset (const std::string &rootName) |
void | reset (const std::string &rootName, int version) |
void | reset (const std::string &rootName, int version, bool multiSections) |
void | write (config::SourceFormat format, std::string *content) |
void | write (const std::string &filename) |
Variables | |
GlobalConfigParser & | root = GlobalConfigParser::parser() |
The namespace 'config' contains routines for interacting with the global configuration file parser.
enum bitpit::config::SourceFormat |
Definition at line 31 of file configuration_common.hpp.
bool bitpit::config::hasArraySupport | ( | SourceFormat | format | ) |
Check if the specified source format supports arrays.
format | is the format of the source |
Definition at line 52 of file configuration_common.cpp.
bool bitpit::config::hasRootSection | ( | SourceFormat | format | ) |
Check if the specified source format has a root section.
format | is the format of the source |
Definition at line 37 of file configuration_common.cpp.
void bitpit::config::read | ( | config::SourceFormat | format, |
const std::string & | content, | ||
bool | append ) |
Read the specified configuration file.
Configuration file can be either XML or JSON files (if JSON support was found at compile time).
format | is the format of the content |
content | is the content that will be read |
append | controls if the configuration file will be appended to the current configuration or if the current configuration will be overwritten with the contents of the configuration file. |
Definition at line 418 of file configuration.cpp.
void bitpit::config::read | ( | const std::string & | filename, |
bool | append ) |
Read the specified configuration file.
Configuration can be read either from XML or JSON files.
filename | is the filename of the configuration file |
append | controls if the configuration file will be appended to the current configuration or if the current configuration will be overwritten with the contents of the configuration file. |
Definition at line 401 of file configuration.cpp.
void bitpit::config::reset | ( | const std::string & | rootName | ) |
Resets to custom root element name, all other options are forcefully reset to default. MultiSection property remains unaffected by the reset
rootName | is the name of the root element |
Definition at line 361 of file configuration.cpp.
void bitpit::config::reset | ( | const std::string & | rootName, |
int | version ) |
Resets to custom root element name and version. , all other options are forcefully reset to default. MultiSection property remains unaffected by the reset.
rootName | is the name of the root element |
version | is the version |
Definition at line 374 of file configuration.cpp.
void bitpit::config::reset | ( | const std::string & | rootName, |
int | version, | ||
bool | multiSections ) |
Resets to custom root element name, version and multiSections property
rootName | is the name of the root element |
version | is the version |
multiSections | boolean to control multiSections property of Config tree |
Definition at line 386 of file configuration.cpp.
void bitpit::config::write | ( | config::SourceFormat | format, |
std::string * | content ) |
Write the configuration to the specified string.
Configuration can be written either in XML or JSON format.
format | is the format that will be used to write the configuration |
content | on output will contain the configuration in the specified format |
Definition at line 443 of file configuration.cpp.
void bitpit::config::write | ( | const std::string & | filename | ) |
Write the configuration to the specified file.
Configuration can be written either to XML or JSON files.
filename | is the filename where the configuration will be written to |
Definition at line 430 of file configuration.cpp.
BITPIT_PUBLIC_API GlobalConfigParser & bitpit::config::root = GlobalConfigParser::parser() |
Global instance of the configuration file parser.
Definition at line 353 of file configuration.cpp.