Class to parse a configuration file and apply logic based on section-key pairs.
More...
#include <config_file_parser.hpp>
|
| | Configuration (const std::filesystem::path &config_path, const SectionKeyPairToConfigLogic &config_logic={}, bool apply=true) |
| |
| void | reload_config_from_file () |
| |
| void | register_config_handler (const std::string §ion, const std::string &key, std::function< void(const std::string)> logic) |
| |
| bool | set_value (const std::string §ion, const std::string &key, const std::string &value, const bool apply=false) |
| |
| std::optional< std::string > | get_value (const std::string §ion, const std::string &key) |
| |
| bool | remove_value (const std::string §ion, const std::string &key) |
| |
| bool | has_section (const std::string §ion) const |
| |
| bool | has_value (const std::string §ion, const std::string &key) |
| |
| std::vector< std::string > | get_sections () const |
| |
| std::vector< std::string > | get_keys (const std::string §ion) |
| |
| bool | save_to_file () |
| |
| bool | save_to_file (const std::filesystem::path &path) |
| |
| bool | backup_config (const std::filesystem::path &backup_path) |
| |
| void | apply_config_logic_for_key (const std::string §ion, const std::string &key) |
| |
| void | apply_config_logic () |
| |
Class to parse a configuration file and apply logic based on section-key pairs.
◆ ConfigData
◆ ConfigLogic
◆ SectionKeyPair
◆ SectionKeyPairToConfigLogic
◆ Configuration()
| Configuration::Configuration |
( |
const std::filesystem::path & | config_path, |
|
|
const SectionKeyPairToConfigLogic & | config_logic = {}, |
|
|
bool | apply = true ) |
◆ apply_config_logic()
| void Configuration::apply_config_logic |
( |
| ) |
|
◆ apply_config_logic_for_key()
| void Configuration::apply_config_logic_for_key |
( |
const std::string & | section, |
|
|
const std::string & | key ) |
◆ backup_config()
| bool Configuration::backup_config |
( |
const std::filesystem::path & | backup_path | ) |
|
◆ get_keys()
| std::vector< std::string > Configuration::get_keys |
( |
const std::string & | section | ) |
|
◆ get_sections()
| std::vector< std::string > Configuration::get_sections |
( |
| ) |
const |
◆ get_value()
| std::optional< std::string > Configuration::get_value |
( |
const std::string & | section, |
|
|
const std::string & | key ) |
◆ has_section()
| bool Configuration::has_section |
( |
const std::string & | section | ) |
const |
◆ has_value()
| bool Configuration::has_value |
( |
const std::string & | section, |
|
|
const std::string & | key ) |
◆ register_config_handler()
| void Configuration::register_config_handler |
( |
const std::string & | section, |
|
|
const std::string & | key, |
|
|
std::function< void(const std::string)> | logic ) |
◆ reload_config_from_file()
| void Configuration::reload_config_from_file |
( |
| ) |
|
◆ remove_value()
| bool Configuration::remove_value |
( |
const std::string & | section, |
|
|
const std::string & | key ) |
◆ save_to_file() [1/2]
| bool Configuration::save_to_file |
( |
| ) |
|
◆ save_to_file() [2/2]
| bool Configuration::save_to_file |
( |
const std::filesystem::path & | path | ) |
|
◆ set_value()
| bool Configuration::set_value |
( |
const std::string & | section, |
|
|
const std::string & | key, |
|
|
const std::string & | value, |
|
|
const bool | apply = false ) |
The documentation for this class was generated from the following files: