A configuration manager support class: Used to parse a configuration file from the perspective of a global context. More...
#include <rconfig.h>
Public Member Functions | |
global_parser (const std::string &a_path, uint16 &a_line, std::istream &a_in) | |
C'tor. | |
Private Member Functions | |
const std::string | location (void) |
Generate a string showing the current location within a configuration file of the parser. | |
void | read_config (const std::string &a_path) |
Read a configuration file, used by the "include" command. | |
void | read_job (const std::string &a_path, job &a_job) |
Read a job configuration file, used by the "include-job" command. | |
void | parse (void) |
Global context parser. | |
void | parse_default (const std::string &a_value) |
Parse a default job context. | |
void | parse_include (const std::string &a_value) |
Parse an "include" command. | |
void | parse_include_job (const std::string &a_value) |
Parse an "include-job" command. | |
void | parse_job (const std::string &a_value) |
Parse a job context. | |
void | parse_link_catalog_dir (const std::string &a_value) |
Parse a "link-catalog-dir" command. | |
void | parse_log_dir (const std::string &a_value) |
Parse a "log-dir" command. | |
void | parse_delete_old_log_files (const std::string &a_value) |
Parse a "delete-old-log-files" command. | |
void | parse_delete_old_report_files (const std::string &a_value) |
Parse a "delete-old-report-files" command. | |
void | parse_logging_level (const std::string &a_value) |
Parse a "loging-level" command. | |
void | parse_error_logging_level (const std::string &a_value) |
Parse a "error-loging-level" command. | |
void | parse_rsync_local_path (const std::string &a_value) |
Parse an "rsync-local-path" command. | |
void | parse_rsync_parallel (const std::string &a_value) |
Parse an "rsync-parallel" command. | |
void | parse_io_poll_interval (const std::string &a_value) |
Parse "io-poll-interval" command. | |
void | parse_timestamp_resolution (const std::string &a_value) |
Parse a "timestamp-resolution" command. | |
void | parse_vault (const std::string &a_value) |
Parse a "vault" command. | |
void | parse_vault_overflow_behavior (const std::string &a_value) |
Parse a "vault-overflow-behavior" command. | |
void | parse_vault_overflow_blocks (const std::string &a_value) |
Parse a "vault-overflow-blocks" command. | |
void | parse_vault_overflow_inodes (const std::string &a_value) |
Parse a "vault-overflow-inodes" command. | |
void | parse_vault_selection_behavior (const std::string &a_value) |
Parse a "vault-selection-behavior" command. | |
void | parse_vault_locking (const std::string &a_value) |
Parse a "vault-locking" command. | |
Private Attributes | |
const std::string * | m_path |
std::istream * | m_in |
uint16 * | m_line |
A configuration manager support class: Used to parse a configuration file from the perspective of a global context.
Definition at line 308 of file rconfig.h.
global_parser::global_parser | ( | const std::string & | a_path, | |
uint16 & | a_line, | |||
std::istream & | a_in | |||
) |
C'tor.
Definition at line 1704 of file rconfig.cc.
References m_in, m_line, m_path, and parse().
Referenced by read_config().
const std::string global_parser::location | ( | void | ) | [private] |
void global_parser::parse | ( | void | ) | [private] |
Global context parser.
Definition at line 1778 of file rconfig.cc.
References err_unknown, ERROR, ERROR_INSTANCE, location(), m_in, parse_default(), parse_delete_old_log_files(), parse_delete_old_report_files(), parse_error_logging_level(), parse_include(), parse_include_job(), parse_io_poll_interval(), parse_job(), parse_line(), parse_link_catalog_dir(), parse_log_dir(), parse_logging_level(), parse_rsync_local_path(), parse_rsync_parallel(), parse_timestamp_resolution(), parse_vault(), parse_vault_locking(), parse_vault_overflow_behavior(), parse_vault_overflow_blocks(), parse_vault_overflow_inodes(), parse_vault_selection_behavior(), error::push_back(), and TRY_nomem.
Referenced by global_parser().
void global_parser::parse_default | ( | const std::string & | a_value | ) | [private] |
Parse a default job context.
Definition at line 1898 of file rconfig.cc.
References job::clear(), config, job::default_config_line, job::default_config_path, configuration_manager::m_default_job, m_in, m_line, m_path, and TRY_nomem.
Referenced by parse().
void global_parser::parse_delete_old_log_files | ( | const std::string & | a_value | ) | [private] |
Parse a "delete-old-log-files" command.
Definition at line 2078 of file rconfig.cc.
References config, ERROR, configuration_manager::m_delete_old_log_files, timestamp::str(), TRY, and TRY_nomem.
Referenced by parse().
void global_parser::parse_delete_old_report_files | ( | const std::string & | a_value | ) | [private] |
Parse a "delete-old-report-files" command.
Definition at line 2113 of file rconfig.cc.
References config, ERROR, configuration_manager::m_delete_old_report_files, timestamp::str(), TRY, and TRY_nomem.
Referenced by parse().
void global_parser::parse_error_logging_level | ( | const std::string & | a_value | ) | [private] |
Parse a "error-loging-level" command.
Definition at line 2172 of file rconfig.cc.
References config, ERROR, configuration_manager::logging_child, configuration_manager::logging_manager, configuration_manager::logging_rsync, configuration_manager::m_error_logging_level, timestamp::str(), and TRY_nomem.
Referenced by parse().
void global_parser::parse_include | ( | const std::string & | a_value | ) | [private] |
Parse an "include" command.
Definition at line 1918 of file rconfig.cc.
References err_unknown, ERROR, ERROR_INSTANCE, m_path, parse_dirname(), directory::path(), error::push_back(), read_config(), TRY_instead, and TRY_nomem.
Referenced by parse().
void global_parser::parse_include_job | ( | const std::string & | a_value | ) | [private] |
Parse an "include-job" command.
Definition at line 1971 of file rconfig.cc.
References config, err_unknown, ERROR, ERROR_INSTANCE, configuration_manager::m_default_job, configuration_manager::m_jobs, m_path, parse_dirname(), directory::path(), error::push_back(), read_job(), TRY, and TRY_nomem.
Referenced by parse().
void global_parser::parse_io_poll_interval | ( | const std::string & | a_value | ) | [private] |
Parse "io-poll-interval" command.
Definition at line 2224 of file rconfig.cc.
References config, ERROR, configuration_manager::m_io_poll_interval, TRY_instead, and TRY_nomem.
Referenced by parse().
void global_parser::parse_job | ( | const std::string & | a_value | ) | [private] |
Parse a job context.
Definition at line 2029 of file rconfig.cc.
References job::check(), config, job::config_line, job::config_path, configuration_manager::m_default_job, m_in, configuration_manager::m_jobs, m_line, m_path, and TRY_nomem.
Referenced by parse().
void global_parser::parse_link_catalog_dir | ( | const std::string & | a_value | ) | [private] |
Parse a "link-catalog-dir" command.
Definition at line 2052 of file rconfig.cc.
References config, configuration_manager::m_link_catalog_dir, subdirectory::path(), TRY_instead, and TRY_nomem.
Referenced by parse().
void global_parser::parse_log_dir | ( | const std::string & | a_value | ) | [private] |
Parse a "log-dir" command.
Definition at line 2065 of file rconfig.cc.
References config, configuration_manager::m_log_dir, subdirectory::path(), TRY_instead, and TRY_nomem.
Referenced by parse().
void global_parser::parse_logging_level | ( | const std::string & | a_value | ) | [private] |
Parse a "loging-level" command.
Definition at line 2148 of file rconfig.cc.
References config, ERROR, configuration_manager::logging_child, configuration_manager::logging_manager, configuration_manager::logging_rsync, configuration_manager::m_logging_level, timestamp::str(), and TRY_nomem.
Referenced by parse().
void global_parser::parse_rsync_local_path | ( | const std::string & | a_value | ) | [private] |
Parse an "rsync-local-path" command.
Definition at line 2196 of file rconfig.cc.
References config, configuration_manager::m_rsync_local_path, filestatus::path(), TRY_instead, and TRY_nomem.
Referenced by parse().
void global_parser::parse_rsync_parallel | ( | const std::string & | a_value | ) | [private] |
Parse an "rsync-parallel" command.
Definition at line 2209 of file rconfig.cc.
References config, ERROR, configuration_manager::m_rsync_parallel, TRY_instead, and TRY_nomem.
Referenced by parse().
void global_parser::parse_timestamp_resolution | ( | const std::string & | a_value | ) | [private] |
Parse a "timestamp-resolution" command.
Definition at line 2239 of file rconfig.cc.
References config, ERROR, configuration_manager::m_timestamp, timestamp::resolution(), timestamp::resolution_day, timestamp::resolution_hour, timestamp::resolution_minute, timestamp::resolution_month, timestamp::resolution_second, timestamp::resolution_year, timestamp::str(), TRY, and TRY_nomem.
Referenced by parse().
void global_parser::parse_vault | ( | const std::string & | a_value | ) | [private] |
Parse a "vault" command.
Definition at line 2272 of file rconfig.cc.
References config, ERROR, executable(), get_error_str(), configuration_manager::m_vaults, filestatus::path(), directory::path(), error::push_back(), readable(), TRY, TRY_instead, TRY_nomem, and writable().
Referenced by parse().
void global_parser::parse_vault_locking | ( | const std::string & | a_value | ) | [private] |
Parse a "vault-locking" command.
Definition at line 2412 of file rconfig.cc.
References config, ERROR, configuration_manager::m_vault_locking, timestamp::str(), TRY, and TRY_nomem.
Referenced by parse().
void global_parser::parse_vault_overflow_behavior | ( | const std::string & | a_value | ) | [private] |
Parse a "vault-overflow-behavior" command.
Definition at line 2337 of file rconfig.cc.
References config, ERROR, configuration_manager::m_vault_overflow_behavior, configuration_manager::overflow_delete_oldest, configuration_manager::overflow_delete_until_free, configuration_manager::overflow_quit, timestamp::str(), TRY, and TRY_nomem.
Referenced by parse().
void global_parser::parse_vault_overflow_blocks | ( | const std::string & | a_value | ) | [private] |
Parse a "vault-overflow-blocks" command.
Definition at line 2361 of file rconfig.cc.
References config, ERROR, configuration_manager::m_vault_overflow_blocks, TRY, and TRY_nomem.
Referenced by parse().
void global_parser::parse_vault_overflow_inodes | ( | const std::string & | a_value | ) | [private] |
Parse a "vault-overflow-inodes" command.
Definition at line 2376 of file rconfig.cc.
References config, ERROR, configuration_manager::m_vault_overflow_inodes, TRY, and TRY_nomem.
Referenced by parse().
void global_parser::parse_vault_selection_behavior | ( | const std::string & | a_value | ) | [private] |
Parse a "vault-selection-behavior" command.
Definition at line 2391 of file rconfig.cc.
References config, ERROR, configuration_manager::m_vault_selection_behavior, configuration_manager::selection_max_free, configuration_manager::selection_round_robin, timestamp::str(), TRY, and TRY_nomem.
Referenced by parse().
void global_parser::read_config | ( | const std::string & | a_path | ) | [private] |
Read a configuration file, used by the "include" command.
Definition at line 1733 of file rconfig.cc.
References config, ERROR, global_parser(), configuration_manager::m_configs_read, and TRY_nomem.
Referenced by parse_include().
void global_parser::read_job | ( | const std::string & | a_path, | |
job & | a_job | |||
) | [private] |
Read a job configuration file, used by the "include-job" command.
Definition at line 1754 of file rconfig.cc.
References job::check(), job::config_line, job::config_path, ERROR, m_line, m_path, and TRY_nomem.
Referenced by parse_include_job().
std::istream* global_parser::m_in [private] |
Definition at line 319 of file rconfig.h.
Referenced by global_parser(), parse(), parse_default(), and parse_job().
uint16* global_parser::m_line [private] |
Definition at line 320 of file rconfig.h.
Referenced by global_parser(), location(), parse_default(), parse_job(), and read_job().
const std::string* global_parser::m_path [private] |
Definition at line 318 of file rconfig.h.
Referenced by global_parser(), location(), parse_default(), parse_include(), parse_include_job(), parse_job(), and read_job().