#include <ConfigTree.hpp>
Inheritance diagram for Ionflux::Tools::ConfigTree:
Public Member Functions | |
ConfigTree () | |
Constructor. | |
virtual | ~ConfigTree () |
Destructor. | |
virtual void | clear () |
Clear all configuration data. | |
virtual void | parseConfig (const std::string &configData) |
Parse configuration data. | |
virtual void | readConfig (const std::string &configFile) |
Read configuration from a file. | |
virtual void | writeConfig (const std::string &configFile) |
Write configuration to a file. | |
virtual void | writeConfig () |
Write configuration to a file. | |
virtual std::string | get (const std::string &key) |
Get a configuration value. | |
virtual void | set (const std::string &key, const std::string &value) |
Set a configuration value. | |
virtual void | dump (Node *node) |
Process a tree node. | |
Static Public Member Functions | |
static std::string | escapeValue (const std::string &value) |
Escape configuration value. | |
Static Public Attributes | |
static const TokenType | TT_COMMENT |
Token type: Comment. | |
static const TokenType | TT_ASSIGN |
Token type: Assignment operator. | |
static const TokenType | TT_MULTILINE |
Token type: Multi-line option marker. | |
static const TokenType | TT_TREEPATH |
Token type: Tree path elements. | |
static const TokenType | TT_NESTED_OPEN |
Token type: Nested configuration (open). | |
static const TokenType | TT_NESTED_CLOSE |
Token type: Nested configuration (close). | |
static const std::string | AUTO_INSERT_MARKER |
Auto-insertion marker. | |
static const std::string | SPECIAL_VALUE_CHARS = "{}\n" |
Special characters in configuration values. | |
Protected Member Functions | |
virtual int | findFirstLine (Node *searchNode) |
Find a configuration line. | |
virtual int | findLastLine (Node *searchNode) |
Find a configuration line. | |
virtual int | getAutoInsertPos () |
Get auto-insert position. | |
Protected Attributes | |
std::string | inputFile |
Configuration source file. | |
Tokenizer | tok |
Configuration line tokenizer. | |
std::vector< ConfigTreeEntry > | entries |
Vector of configuration tree entries. |
A tree containing configuration data. (See Configuration file I/O for details)
|
Constructor. Construct new ConfigTree object. |
|
Destructor. Destruct ConfigTree object. |
|
Clear all configuration data. Effectively erases all configuration data from the ConfigTree object. Implements Ionflux::Tools::Config. |
|
Process a tree node. Tree traversal callback, used for updating the configuration file. The data of the node will be added to or updated in the configuration file entry table
Implements Ionflux::Tools::NodeDump. |
|
Escape configuration value. Escapes special characters in a configuration value, making the value suitable for a configuration file.
|
|
Find a configuration line. Searches for the first line in the configuration file that defines the specified node. Returns -1 if the node is not found.
|
|
Find a configuration line. Searches for the last line in the configuration file that defines the specified node. Returns -1 if the node is not found.
|
|
Get a configuration value. Fetches the value of a configuration option from the configuration table.
Implements Ionflux::Tools::Config. |
|
Get auto-insert position. Fetch the correct line for auto-insertion of values.
|
|
Parse configuration data. Parses configuration data, with syntax as specified for ConfigTree.
|
|
Read configuration from a file. Reads data from a configuration file and stores it in the configuration table.
Implements Ionflux::Tools::Config. |
|
Set a configuration value. Sets the configuration option denoted by key to value.
Implements Ionflux::Tools::Config. |
|
Write configuration to a file. Writes configuration data stored in the ConfigTree object to the same file it was read from. Implements Ionflux::Tools::Config. |
|
Write configuration to a file. Writes configuration data stored in the ConfigTree object to a file.
Implements Ionflux::Tools::Config. |
|
Initial value: "# ------- Values inserted automatically by the configuration system " "--------"
|
|
Vector of configuration tree entries.
|
|
Configuration source file.
|
|
Special characters in configuration values.
|
|
Configuration line tokenizer.
|
|
Initial value: { TokenType::USERTYPE_ID + 2, "=", false, 1}
|
|
Initial value: { TokenType::USERTYPE_ID + 1, "#", false, 1}
|
|
Initial value: { TokenType::USERTYPE_ID + 3, "\\", false, 1}
|
|
Initial value: { TokenType::USERTYPE_ID + 6, "}", false, 1}
|
|
Initial value: { TokenType::USERTYPE_ID + 5, "{", false, 1}
|
|
Initial value: { TokenType::USERTYPE_ID + 4, ".[]()", false, 0}
|