44 void assign(
const std::string& a_str);
47 const std::string&
value(
void)
const;
48 const std::string
str(
void)
const;
66 typedef std::vector<archive_path_element>
type;
81 void assign(
const std::string& a_str);
83 const std::string
str(
void)
const;
117 void assign(
const std::string& a_str);
240 void init(
int argc,
char const *argv[]);
241 void check(
void)
const;
251 const std::string&
log_dir(
void)
const;
303 void read_job(
const std::string& a_path);
308 std::string& a_keyword,
319 const std::string& a_path,
331 void read_job(
const std::string& a_path,
job& a_job);
337 void parse_job(
const std::string& a_value);
366 const std::string& a_path,
369 const std::string& a_block_delimiter,
370 const bool a_default_context
382 void read_job(
const std::string& a_path);
void init(int argc, char const *argv[])
Initialize the configuration manager from rvm's command line options.
uint16 rsync_multi_hardlink_max
rsync_connection_type rsync_connection
void assign(const job &a_job)
Assign values from another job instance.
void parse_exclude_from(const std::string &a_value)
Parse an "exclude-from" command.
const std::string location(void)
Generate a string showing the current location within a configuration file of the parser...
void parse_rsync_retry_delay(const std::string &a_value)
Parse an "rsync-retry-delay" command.
const std::string & rsync_local_path(void) const
Return the rsync-local-path.
overflow_type m_vault_overflow_behavior
void reset(void)
Clear all values and set some sane default actions.
Basic types definitions and templates.
void check(void)
Perform sanity checks for the configuration settings of this job.
const std::string generate_job_id(void) const
Generate a unique ID string for this job.
const uint16 & vault_overflow_blocks(void) const
Return the vault-overflow-blocks.
void read_job(const std::string &a_path, job &a_job)
Read a job configuration file, used by the "include-job" command.
void parse_path(const std::string &a_value)
Parse a "path" command.
bool m_delete_old_log_files
configuration_manager()
C'tor.
std::vector< job > jobs_type
uint16 m_io_poll_interval
const value_type operator[](const uint16 a_code) const
Return the action to be taken for a given exit code.
void clear(void)
Reset to a default value.
void parse_clear(const std::string &a_value)
Parse a "clear" command.
Hold configuration data for a single job.
void parse_hostname(const std::string &a_value)
Parse a "hostname" command.
void clear(void)
Clear values.
const value_type default_value(void) const
Return the default action.
void parse(void)
Job context parser.
const std::string * m_path
const std::string & value(void) const
Retrieve the current literal value.
std::vector< std::string > m_vaults
const bool delete_old_log_files(void) const
Return the value of delete-old-log-files.
std::vector< std::string > excludes_type
void parse_ssh_options_context(const std::string &a_value)
Parse an ssh-options context.
A configuration manager support class: Used to parse a configuration file from the perspective of a g...
const std::string generate_source_path(const std::string &a_path) const
Generate the source path to be passed to rsync on the command line.
void parse(void)
Global context parser.
void parse_include(const std::string &a_value)
Parse an "include" command.
const uint16 & io_poll_interval(void) const
Return the number of seconds to sleep between polling for I/O.
void parse_include_job(const std::string &a_value)
Parse an "include-job" command.
void parse_archive_path(const std::string &a_value)
Parse an "archive-path" command.
A configuration manager support class: Used to parse a configuration file from the perspective of a j...
const map_type & map_value(void) const
Return an std::map of exit codes to actions.
const std::string location(void)
Construct a string with the current location of the parser in a configuration file.
const class timestamp & timestamp(void) const
Return the timestamp of this instance of rvm.
const std::string & log_dir(void) const
Return the log-dir path.
const action_type action(void) const
Return the action rvm is to take.
const uint16 & rsync_parallel(void) const
Return the rsync-parallel.
void parse_delete_old_report_files(const std::string &a_value)
Parse a "delete-old-report-files" command.
const bool delete_old_report_files(void) const
Return the value of delete-old-report-files.
std::string rsync_remote_module
uint16 m_vault_overflow_blocks
void parse_rsync_remote_user(const std::string &a_value)
Parse a "remote-user" command.
void parse_rsync_remote_port(const std::string &a_value)
Parse an "rsync-remote-port" command.
void default_logdir(const std::string &a_path)
Return the default log-dir.
archive_path_element()
C'tor.
void parse_rsync_multi_hardlink(const std::string &a_value)
Parse an "rsync-multi-hardlink" command.
std::string default_config_path
const uint16 & vault_overflow_inodes(void) const
Return the vault-overflow-inodes.
void parse_vault_overflow_blocks(const std::string &a_value)
Parse a "vault-overflow-blocks" command.
void parse_job(const std::string &a_value)
Parse a job context.
void parse_rsync_connection_type(const std::string &a_value)
Parse an "rsync-connection-type" command.
const vaults_type & vaults(void) const
Return the vaults.
const selection_type & vault_selection_behavior(void) const
Return the vault-selection-behavior.
std::pair< cfgfile_type, std::string > cfgfile_element
const std::string common_pathname(void) const
Find the common pathname among all job paths (may be an empty string)
void parse_include(const std::string &a_value)
Parse an "include" command.
void parse_rsync_options_context(const std::string &a_value)
Parse an rsync-options context.
A configuration manager support class: Used to specify a single subdirectory in a path of subdirector...
logging_type m_logging_level
void parse_rsync_hardlink(const std::string &a_value)
Parse an "rsync-hardlink" command.
void parse_delete_command_path(const std::string &a_value)
Parse an "delete-command-path" command.
void parse_rsync_behavior(const std::string &a_value)
Parse an "rsync-behavior" command.
void assign(const archive_path &a_class)
Assign an archive-path list from another archive_path instance.
void clear(void)
Reset configuration to default settings.
void parse_timestamp_resolution(const std::string &a_value)
Parse a "timestamp-resolution" command.
void parse_rsync_retry_count(const std::string &a_value)
Parse an "rsync-retry-count" command.
const timestamp::resolution_type timestamp_resolution(void) const
Return the timestamp-resolution.
void parse_vault_overflow_behavior(const std::string &a_value)
Parse a "vault-overflow-behavior" command.
void parse_rsync_multi_hardlink_max(const std::string &a_value)
Parse an "rsync-multi-hardlink-max" command.
void parse_rsync_remote_module(const std::string &a_value)
Parse an "rsync-remote-module" command.
const std::string str(void) const
Reconstruct a string from an archive-path list.
void parse_delete_old_log_files(const std::string &a_value)
Parse a "delete-old-log-files" command.
void parse_include_from(const std::string &a_value)
Parse an "include-from" command.
std::string rsync_remote_user
std::vector< archive_path_element > type
std::vector< std::string > paths_type
std::string m_default_file
global_parser(const std::string &a_path, uint16 &a_line, std::istream &a_in)
C'tor.
uint16 m_vault_overflow_inodes
A configuration manager support class: Used to specify a unique subdirectory in the archive for each ...
static const uint16 default_behavior
Default behavior.
const std::string generate_archive_path(const std::string &a_path) const
Generate the archive-path subdirectory for this job.
void parse_rsync_timeout(const std::string &a_value)
Parse an "rsync-timeout" command.
void parse_logging_level(const std::string &a_value)
Parse a "loging-level" command.
class timestamp m_timestamp
void read_config(const std::string &a_path)
Read a configuration file, used by the "include" command.
void parse_rsync_remote_path(const std::string &a_value)
Parse an "rsync-remote-path" command.
selection_type m_vault_selection_behavior
void parse_vault_selection_behavior(const std::string &a_value)
Parse a "vault-selection-behavior" command.
bool m_delete_old_report_files
const bool initialized(void) const
Return the initialized state of the configuration manager.
void parse_line(std::istream &a_in, std::string &a_keyword, std::string &a_value)
Parse a keyword/value pair read from a configuration file.
void parse_link_catalog_dir(const std::string &a_value)
Parse a "link-catalog-dir" command.
const std::string * m_path
void read_config(const std::string &a_path)
Read a configuration file.
uint16 default_config_line
configuration_manager config
The global configuration manager instance.
std::string rsync_remote_path
std::vector< std::string > vaults_type
void parse_vault_overflow_inodes(const std::string &a_value)
Parse a "vault-overflow-inodes" command.
const std::string & link_catalog_dir(void) const
Return the link-catalog-dir path.
void read_job(const std::string &a_path)
Read a job configuration file.
void parse_vault_locking(const std::string &a_value)
Parse a "vault-locking" command.
void parse_vault(const std::string &a_value)
Parse a "vault" command.
void parse_io_poll_interval(const std::string &a_value)
Parse "io-poll-interval" command.
void parse_rsync_options(const std::string &a_value)
Parse an "rsync-options" command.
void parse_error_logging_level(const std::string &a_value)
Parse a "error-loging-level" command.
const job & default_job(void) const
Return the default job configuration.
void parse_rsync_local_path(const std::string &a_value)
Parse an "rsync-local-path" command.
const bool use_default(void) const
Return whether or not rvm is to try to read it's default configuration file.
void parse_groupname(const std::string &a_value)
Parse a "groupname" command.
A configuration manager support class: Used to map rsync exit codes to actions for rvm to take...
void parse_jobname(const std::string &a_value)
Parse a "jobname" command.
void read_job(const std::string &a_path)
Read a job configuration file, used by the "include" command.
void parse_ssh_options(const std::string &a_value)
Parse an "ssh-options" command.
Keep up with configuration settings for RVM and it's jobs.
class std::vector< cfgfile_element > cfgfiles_type
const std::vector< std::string > generate_ssh_options_vector(void) const
Generate ssh command line options.
const jobs_type & jobs(void) const
Return a list of jobs.
void parse_ssh_local_path(const std::string &a_value)
Parse an "ssh-local-path" command.
void parse_default(const std::string &a_value)
Parse a default job context.
std::string m_link_catalog_dir
void clear(void)
Clear all values and set the default to "retry".
job & operator=(const job &a_job)
Assignment.
const element_type & type(void) const
Retrieve the current type.
const std::vector< std::string > generate_rsync_options_vector(void) const
Generate rsync command line options.
std::vector< std::string > includes_type
logging_type m_error_logging_level
const std::string & delete_command_path(void) const
Return the delete-command-path.
const overflow_type & vault_overflow_behavior(void) const
Return the vault-overflow-behavior.
rsync_behavior & operator=(const rsync_behavior &a_class)
Assignment.
const std::string str(void) const
Construct a string of the current value.
archive_path & operator=(const archive_path &a_class)
Assignment.
const bool vault_locking(void) const
Return the vault-locking selection.
void assign(const archive_path_element &a_class)
Assign the value from another archive_path_element instance.
std::map< uint16, value_type > map_type
void reset(void)
Reset to a default value.
const logging_type & error_logging_level(void) const
Return the error-logging-level.
job_parser(job *a_job, const std::string &a_path, uint16 &a_line, std::istream &a_in, const std::string &a_block_delimiter, const bool a_default_context)
C'tor.
void parse_rsync_parallel(const std::string &a_value)
Parse an "rsync-parallel" command.
const logging_type & logging_level(void) const
Return the logging-level.
bool rsync_multi_hardlink
const std::string & ssh_local_path(void) const
Return the ssh-local-path.
std::string m_ssh_local_path
void assign(const uint16 a_code, const value_type a_action)
Assign an action to be taken for a specific exit code.
void push_back(const archive_path &a_class)
Add elements to the path list from another archive_path instance.
const std::string & default_file(void) const
Return the default configuration filename.
void check(void) const
Perform sanity checks on configuration settings.
void parse_log_dir(const std::string &a_value)
Parse a "log-dir" command.
const std::string * m_delimiter
archive_path_element & operator=(const archive_path_element &a_class)
Assignment.
std::string m_delete_command_path
std::string m_rsync_local_path
std::string rsync_options