rvm  1.11
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rconfig.h
Go to the documentation of this file.
1 #ifndef __rconfig_h__
2 #define __rconfig_h__
3 
4 #include <iostream>
5 #include <fstream>
6 #include <string>
7 #include <vector>
8 #include <map>
9 
10 #include "asserts.h"
11 #include "types.h"
12 #include "tstamp.h"
13 
14 //----------------------------------------------------------------------------
15 
16 class parser;
17 class parse_job;
18 
19 /** A configuration manager support class:
20  Used to specify a single subdirectory in a path of subdirectory names for a
21  unique path under the archive directory for each job
22  */
24 {
25 public:
26  enum element_type {
33  };
34 
35  void clear(void);
36 
39  archive_path_element(const element_type& a_enum);
40  archive_path_element(const std::string& a_str);
41 
42  void assign(const archive_path_element& a_class);
43  void assign(const element_type& a_enum);
44  void assign(const std::string& a_str);
45 
46  const element_type& type(void) const;
47  const std::string& value(void) const;
48  const std::string str(void) const;
49 
52  archive_path_element& operator=(const std::string& a_str);
53 
54 private:
56  std::string m_literal;
57 };
58 
59 /** A configuration manager support class:
60  Used to specify a unique subdirectory in the archive for each job (made up
61  of archive_path_element's)
62  */
63 class archive_path : public std::vector<archive_path_element>
64 {
65 public:
66  typedef std::vector<archive_path_element> type;
67 
68  void reset(void);
69 
70  archive_path();
71  archive_path(const archive_path& a_class);
72  archive_path(const archive_path_element& a_class);
73  archive_path(const std::string& a_class);
74 
75  void push_back(const archive_path& a_class);
76  void push_back(const archive_path_element& a_class);
77  void push_back(const std::string& a_str);
78 
79  void assign(const archive_path& a_class);
80  void assign(const archive_path_element& a_class);
81  void assign(const std::string& a_str);
82 
83  const std::string str(void) const;
84 
85  archive_path& operator=(const archive_path& a_class);
87  archive_path& operator=(const std::string& a_str);
88 
89 private:
90 };
91 
92 /** A configuration manager support class:
93  Used to map rsync exit codes to actions for rvm to take
94  */
96 {
97 public:
104  };
106  typedef std::map<uint16, value_type> map_type;
107  static const uint16 default_behavior = ((uint16)-1);
108 
109  void clear(void);
110  void reset(void);
111 
112  rsync_behavior();
113  rsync_behavior(const rsync_behavior& a_class);
114 
115  void assign(const uint16 a_code, const value_type a_action);
116  void assign(const rsync_behavior& a_class);
117  void assign(const std::string& a_str);
118 
119  const value_type operator[](const uint16 a_code) const;
120  value_type& operator[](const uint16 a_code);
121  rsync_behavior& operator=(const rsync_behavior& a_class);
122  rsync_behavior& operator=(const value_type a_enum);
123  rsync_behavior& operator=(const std::string& a_str);
124 
125  const value_type default_value(void) const;
126  const map_type& map_value(void) const;
127 
128 private:
131 };
132 
134 
135 /** Hold configuration data for a single job */
136 class job
137 {
138 public:
144  };
150  };
151  typedef std::vector<std::string> excludes_type;
152  typedef std::vector<std::string> includes_type;
153  typedef std::vector<std::string> paths_type;
154 
155  job();
156  job(const job& a_job);
157 
158  void clear(void);
159  void assign(const job& a_job);
160 
161  job& operator=(const job& a_job);
162 
163  std::string default_config_path;
165  std::string config_path;
166  uint16 config_line;
170  std::string groupname;
171  std::string hostname;
172  std::string jobname;
179  std::string rsync_options;
180  std::string ssh_options;
181  std::string rsync_remote_user;
182  std::string rsync_remote_path;
183  std::string rsync_remote_module;
188 
189  const std::string generate_archive_path(const std::string& a_path) const;
190  const std::string generate_source_path(const std::string& a_path) const;
191  const std::string generate_job_id(void) const;
192  const std::vector<std::string> generate_rsync_options_vector(void) const;
193  const std::vector<std::string> generate_ssh_options_vector(void) const;
194  const std::string common_pathname(void) const;
195  void check(void);
196 
197 private:
198 
199  friend class parser;
200 };
201 
202 /** Keep up with configuration settings for RVM and it's jobs */
204 {
205 public:
206  enum action_type {
212  };
216  };
221  };
225  };
230  };
231  typedef std::pair<cfgfile_type, std::string> cfgfile_element;
232  typedef class std::vector<cfgfile_element> cfgfiles_type;
233  typedef std::vector<job> jobs_type;
234  typedef std::vector<std::string> vaults_type;
235 
236  void clear(void);
237 
239 
240  void init(int argc, char const *argv[]);
241  void check(void) const;
242  const bool initialized(void) const;
243 
244  const action_type action(void) const;
245  const bool use_default(void) const;
246  void default_file(const std::string& a_path);
247  const std::string& default_file(void) const;
248  void default_logdir(const std::string& a_path);
249  const class timestamp& timestamp(void) const;
250  const std::string& link_catalog_dir(void) const;
251  const std::string& log_dir(void) const;
252  const bool delete_old_log_files(void) const;
253  const bool delete_old_report_files(void) const;
254  const std::string& rsync_local_path(void) const;
255  const std::string& delete_command_path(void) const;
256  const std::string& ssh_local_path(void) const;
257  const uint16& rsync_parallel(void) const;
258  const uint16& io_poll_interval(void) const;
260  const vaults_type& vaults(void) const;
261  const overflow_type& vault_overflow_behavior(void) const;
262  const uint16& vault_overflow_blocks(void) const;
263  const uint16& vault_overflow_inodes(void) const;
264  const selection_type& vault_selection_behavior(void) const;
265  const bool vault_locking(void) const;
266  const job& default_job(void) const;
267  const jobs_type& jobs(void) const;
268  const logging_type& logging_level(void) const;
269  const logging_type& error_logging_level(void) const;
270 
271 private:
274  std::string m_default_file;
276  bool m_default;
279  std::string m_link_catalog_dir;
280  std::string m_log_dir;
281  std::string m_rsync_local_path;
283  std::string m_ssh_local_path;
286  std::vector<std::string> m_vaults;
298 
299  friend class global_parser;
300  friend class job_parser;
301 
302  void read_config(const std::string& a_path);
303  void read_job(const std::string& a_path);
304 };
305 
306 void parse_line(
307  std::istream& a_in,
308  std::string& a_keyword,
309  std::string& a_value
310  );
311 
312 /** A configuration manager support class:
313  Used to parse a configuration file from the perspective of a global context
314  */
316 {
317 public:
319  const std::string& a_path,
320  uint16& a_line,
321  std::istream& a_in
322  );
323 
324 private:
325  const std::string* m_path;
326  std::istream* m_in;
327  uint16* m_line;
328 
329  const std::string location(void);
330  void read_config(const std::string& a_path);
331  void read_job(const std::string& a_path, job& a_job);
332 
333  void parse(void);
334  void parse_default(const std::string& a_value);
335  void parse_include(const std::string& a_value);
336  void parse_include_job(const std::string& a_value);
337  void parse_job(const std::string& a_value);
338  void parse_link_catalog_dir(const std::string& a_value);
339  void parse_log_dir(const std::string& a_value);
340  void parse_delete_old_log_files(const std::string& a_value);
341  void parse_delete_old_report_files(const std::string& a_value);
342  void parse_logging_level(const std::string& a_value);
343  void parse_error_logging_level(const std::string& a_value);
344  void parse_rsync_local_path(const std::string& a_value);
345  void parse_delete_command_path(const std::string& a_value);
346  void parse_ssh_local_path(const std::string& a_value);
347  void parse_rsync_parallel(const std::string& a_value);
348  void parse_io_poll_interval(const std::string& a_value);
349  void parse_timestamp_resolution(const std::string& a_value);
350  void parse_vault(const std::string& a_value);
351  void parse_vault_overflow_behavior(const std::string& a_value);
352  void parse_vault_overflow_blocks(const std::string& a_value);
353  void parse_vault_overflow_inodes(const std::string& a_value);
354  void parse_vault_selection_behavior(const std::string& a_value);
355  void parse_vault_locking(const std::string& a_value);
356 };
357 
358 /** A configuration manager support class:
359  Used to parse a configuration file from the perspective of a job context
360  */
362 {
363 public:
364  job_parser(
365  job * a_job,
366  const std::string& a_path,
367  uint16& a_line,
368  std::istream& a_in,
369  const std::string& a_block_delimiter,
370  const bool a_default_context
371  );
372 
373 private:
375  const std::string* m_path;
376  std::istream* m_in;
377  uint16* m_line;
378  const std::string* m_delimiter;
380 
381  const std::string location(void);
382  void read_job(const std::string& a_path);
383 
384  void parse(void);
385  void parse_archive_path(const std::string& a_value);
386  void parse_clear(const std::string& a_value);
387  void parse_exclude_from(const std::string& a_value);
388  void parse_include_from(const std::string& a_value);
389  void parse_groupname(const std::string& a_value);
390  void parse_hostname(const std::string& a_value);
391  void parse_include(const std::string& a_value);
392  void parse_jobname(const std::string& a_value);
393  void parse_path(const std::string& a_value);
394  void parse_rsync_behavior(const std::string& a_value);
395  void parse_rsync_connection_type(const std::string& a_value);
396  void parse_rsync_hardlink(const std::string& a_value);
397  void parse_rsync_multi_hardlink(const std::string& a_value);
398  void parse_rsync_multi_hardlink_max(const std::string& a_value);
399  void parse_rsync_options(const std::string& a_value);
400  void parse_ssh_options(const std::string& a_value);
401  void parse_rsync_options_context(const std::string& a_value);
402  void parse_ssh_options_context(const std::string& a_value);
403  void parse_rsync_remote_user(const std::string& a_value);
404  void parse_rsync_remote_path(const std::string& a_value);
405  void parse_rsync_remote_port(const std::string& a_value);
406  void parse_rsync_remote_module(const std::string& a_value);
407  void parse_rsync_retry_count(const std::string& a_value);
408  void parse_rsync_retry_delay(const std::string& a_value);
409  void parse_rsync_timeout(const std::string& a_value);
410 };
411 
413 
414 #endif
void init(int argc, char const *argv[])
Initialize the configuration manager from rvm's command line options.
Definition: rconfig.cc:1218
std::istream * m_in
Definition: rconfig.h:326
uint16 rsync_multi_hardlink_max
Definition: rconfig.h:178
Timestamp object.
Definition: tstamp.h:13
value_type m_default
Definition: rconfig.h:130
includes_type includes
Definition: rconfig.h:169
rsync_connection_type rsync_connection
Definition: rconfig.h:175
void assign(const job &a_job)
Assign values from another job instance.
Definition: rconfig.cc:600
void parse_exclude_from(const std::string &a_value)
Parse an "exclude-from" command.
Definition: rconfig.cc:2890
const std::string location(void)
Generate a string showing the current location within a configuration file of the parser...
Definition: rconfig.cc:1862
uint16 rsync_retry_delay
Definition: rconfig.h:186
void parse_rsync_retry_delay(const std::string &a_value)
Parse an "rsync-retry-delay" command.
Definition: rconfig.cc:3332
const std::string & rsync_local_path(void) const
Return the rsync-local-path.
Definition: rconfig.cc:1550
rsync_behavior_type
Definition: rconfig.h:145
overflow_type m_vault_overflow_behavior
Definition: rconfig.h:287
void reset(void)
Clear all values and set some sane default actions.
Definition: rconfig.cc:385
Basic types definitions and templates.
void check(void)
Perform sanity checks for the configuration settings of this job.
Definition: rconfig.cc:1016
const std::string generate_job_id(void) const
Generate a unique ID string for this job.
Definition: rconfig.cc:800
uint16 * m_line
Definition: rconfig.h:377
job()
C'tor.
Definition: rconfig.cc:557
const uint16 & vault_overflow_blocks(void) const
Return the vault-overflow-blocks.
Definition: rconfig.cc:1622
void read_job(const std::string &a_path, job &a_job)
Read a job configuration file, used by the "include-job" command.
Definition: rconfig.cc:1897
void parse_path(const std::string &a_value)
Parse a "path" command.
Definition: rconfig.cc:3029
bool m_delete_old_log_files
Definition: rconfig.h:292
jobs_type m_jobs
Definition: rconfig.h:295
configuration_manager()
C'tor.
Definition: rconfig.cc:1208
std::vector< job > jobs_type
Definition: rconfig.h:233
uint16 m_io_poll_interval
Definition: rconfig.h:285
const value_type operator[](const uint16 a_code) const
Return the action to be taken for a given exit code.
Definition: rconfig.cc:496
void clear(void)
Reset to a default value.
Definition: rconfig.cc:22
void parse_clear(const std::string &a_value)
Parse a "clear" command.
Definition: rconfig.cc:2833
uint16 config_line
Definition: rconfig.h:166
std::string ssh_options
Definition: rconfig.h:180
Hold configuration data for a single job.
Definition: rconfig.h:136
void parse_hostname(const std::string &a_value)
Parse a "hostname" command.
Definition: rconfig.cc:2964
void clear(void)
Clear values.
Definition: rconfig.cc:570
const value_type default_value(void) const
Return the default action.
Definition: rconfig.cc:543
std::string m_log_dir
Definition: rconfig.h:280
bool m_default_context
Definition: rconfig.h:379
void parse(void)
Job context parser.
Definition: rconfig.cc:2679
const std::string * m_path
Definition: rconfig.h:325
const std::string & value(void) const
Retrieve the current literal value.
Definition: rconfig.cc:151
std::vector< std::string > m_vaults
Definition: rconfig.h:286
const bool delete_old_log_files(void) const
Return the value of delete-old-log-files.
Definition: rconfig.cc:1532
std::vector< std::string > excludes_type
Definition: rconfig.h:151
void parse_ssh_options_context(const std::string &a_value)
Parse an ssh-options context.
Definition: rconfig.cc:3240
A configuration manager support class: Used to parse a configuration file from the perspective of a g...
Definition: rconfig.h:315
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.
Definition: rconfig.cc:728
void parse(void)
Global context parser.
Definition: rconfig.cc:1921
void parse_include(const std::string &a_value)
Parse an "include" command.
Definition: rconfig.cc:2067
excludes_type excludes
Definition: rconfig.h:168
const uint16 & io_poll_interval(void) const
Return the number of seconds to sleep between polling for I/O.
Definition: rconfig.cc:1586
void parse_include_job(const std::string &a_value)
Parse an "include-job" command.
Definition: rconfig.cc:2120
void parse_archive_path(const std::string &a_value)
Parse an "archive-path" command.
Definition: rconfig.cc:2824
A configuration manager support class: Used to parse a configuration file from the perspective of a j...
Definition: rconfig.h:361
uint16 rsync_remote_port
Definition: rconfig.h:184
const map_type & map_value(void) const
Return an std::map of exit codes to actions.
Definition: rconfig.cc:549
std::string m_literal
Definition: rconfig.h:56
const std::string location(void)
Construct a string with the current location of the parser in a configuration file.
Definition: rconfig.cc:2645
const class timestamp & timestamp(void) const
Return the timestamp of this instance of rvm.
Definition: rconfig.cc:1505
const std::string & log_dir(void) const
Return the log-dir path.
Definition: rconfig.cc:1523
const action_type action(void) const
Return the action rvm is to take.
Definition: rconfig.cc:1466
const uint16 & rsync_parallel(void) const
Return the rsync-parallel.
Definition: rconfig.cc:1577
void parse_delete_old_report_files(const std::string &a_value)
Parse a "delete-old-report-files" command.
Definition: rconfig.cc:2262
const bool delete_old_report_files(void) const
Return the value of delete-old-report-files.
Definition: rconfig.cc:1541
std::string rsync_remote_module
Definition: rconfig.h:183
uint16 m_vault_overflow_blocks
Definition: rconfig.h:288
void parse_rsync_remote_user(const std::string &a_value)
Parse a "remote-user" command.
Definition: rconfig.cc:3284
uint16 m_rsync_parallel
Definition: rconfig.h:284
void parse_rsync_remote_port(const std::string &a_value)
Parse an "rsync-remote-port" command.
Definition: rconfig.cc:3296
void default_logdir(const std::string &a_path)
Return the default log-dir.
Definition: rconfig.cc:1499
archive_path_element()
C'tor.
Definition: rconfig.cc:29
void parse_rsync_multi_hardlink(const std::string &a_value)
Parse an "rsync-multi-hardlink" command.
Definition: rconfig.cc:3117
std::string default_config_path
Definition: rconfig.h:163
const uint16 & vault_overflow_inodes(void) const
Return the vault-overflow-inodes.
Definition: rconfig.cc:1631
void parse_vault_overflow_blocks(const std::string &a_value)
Parse a "vault-overflow-blocks" command.
Definition: rconfig.cc:2536
void parse_job(const std::string &a_value)
Parse a job context.
Definition: rconfig.cc:2178
void parse_rsync_connection_type(const std::string &a_value)
Parse an "rsync-connection-type" command.
Definition: rconfig.cc:3055
const vaults_type & vaults(void) const
Return the vaults.
Definition: rconfig.cc:1604
const selection_type & vault_selection_behavior(void) const
Return the vault-selection-behavior.
Definition: rconfig.cc:1640
cfgfiles_type m_cfgfiles
Definition: rconfig.h:278
std::pair< cfgfile_type, std::string > cfgfile_element
Definition: rconfig.h:231
const std::string common_pathname(void) const
Find the common pathname among all job paths (may be an empty string)
Definition: rconfig.cc:764
void parse_include(const std::string &a_value)
Parse an "include" command.
Definition: rconfig.cc:2970
uint16 * m_line
Definition: rconfig.h:327
friend class parser
Definition: rconfig.h:199
void parse_rsync_options_context(const std::string &a_value)
Parse an rsync-options context.
Definition: rconfig.cc:3196
A configuration manager support class: Used to specify a single subdirectory in a path of subdirector...
Definition: rconfig.h:23
uint16 rsync_retry_count
Definition: rconfig.h:185
map_type m_map
Definition: rconfig.h:129
logging_type m_logging_level
Definition: rconfig.h:296
void parse_rsync_hardlink(const std::string &a_value)
Parse an "rsync-hardlink" command.
Definition: rconfig.cc:3082
void parse_delete_command_path(const std::string &a_value)
Parse an "delete-command-path" command.
Definition: rconfig.cc:2358
void parse_rsync_behavior(const std::string &a_value)
Parse an "rsync-behavior" command.
Definition: rconfig.cc:3035
void assign(const archive_path &a_class)
Assign an archive-path list from another archive_path instance.
Definition: rconfig.cc:326
job * m_job
Definition: rconfig.h:374
void clear(void)
Reset configuration to default settings.
Definition: rconfig.cc:1171
void parse_timestamp_resolution(const std::string &a_value)
Parse a "timestamp-resolution" command.
Definition: rconfig.cc:2414
void parse_rsync_retry_count(const std::string &a_value)
Parse an "rsync-retry-count" command.
Definition: rconfig.cc:3317
const timestamp::resolution_type timestamp_resolution(void) const
Return the timestamp-resolution.
Definition: rconfig.cc:1595
void parse_vault_overflow_behavior(const std::string &a_value)
Parse a "vault-overflow-behavior" command.
Definition: rconfig.cc:2512
void parse_rsync_multi_hardlink_max(const std::string &a_value)
Parse an "rsync-multi-hardlink-max" command.
Definition: rconfig.cc:3153
void parse_rsync_remote_module(const std::string &a_value)
Parse an "rsync-remote-module" command.
Definition: rconfig.cc:3311
archive_path()
C'tor.
Definition: rconfig.cc:232
const std::string str(void) const
Reconstruct a string from an archive-path list.
Definition: rconfig.cc:310
void parse_delete_old_log_files(const std::string &a_value)
Parse a "delete-old-log-files" command.
Definition: rconfig.cc:2227
void parse_include_from(const std::string &a_value)
Parse an "include-from" command.
Definition: rconfig.cc:2924
std::string rsync_remote_user
Definition: rconfig.h:181
action_type m_action
Definition: rconfig.h:275
std::vector< archive_path_element > type
Definition: rconfig.h:66
std::vector< std::string > paths_type
Definition: rconfig.h:153
std::string m_default_file
Definition: rconfig.h:274
global_parser(const std::string &a_path, uint16 &a_line, std::istream &a_in)
C'tor.
Definition: rconfig.cc:1847
uint16 m_vault_overflow_inodes
Definition: rconfig.h:289
A configuration manager support class: Used to specify a unique subdirectory in the archive for each ...
Definition: rconfig.h:63
uint16 rsync_timeout
Definition: rconfig.h:187
static const uint16 default_behavior
Default behavior.
Definition: rconfig.h:107
const std::string generate_archive_path(const std::string &a_path) const
Generate the archive-path subdirectory for this job.
Definition: rconfig.cc:641
void parse_rsync_timeout(const std::string &a_value)
Parse an "rsync-timeout" command.
Definition: rconfig.cc:3347
void parse_logging_level(const std::string &a_value)
Parse a "loging-level" command.
Definition: rconfig.cc:2297
class timestamp m_timestamp
Definition: rconfig.h:277
void read_config(const std::string &a_path)
Read a configuration file, used by the "include" command.
Definition: rconfig.cc:1876
void parse_rsync_remote_path(const std::string &a_value)
Parse an "rsync-remote-path" command.
Definition: rconfig.cc:3290
std::string groupname
Definition: rconfig.h:170
selection_type m_vault_selection_behavior
Definition: rconfig.h:290
void parse_vault_selection_behavior(const std::string &a_value)
Parse a "vault-selection-behavior" command.
Definition: rconfig.cc:2566
bool m_delete_old_report_files
Definition: rconfig.h:293
std::string jobname
Definition: rconfig.h:172
const bool initialized(void) const
Return the initialized state of the configuration manager.
Definition: rconfig.cc:1459
bool rsync_hardlink
Definition: rconfig.h:176
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.
Definition: rconfig.cc:1742
void parse_link_catalog_dir(const std::string &a_value)
Parse a "link-catalog-dir" command.
Definition: rconfig.cc:2201
const std::string * m_path
Definition: rconfig.h:375
behavior_type value_type
Definition: rconfig.h:105
std::string hostname
Definition: rconfig.h:171
void read_config(const std::string &a_path)
Read a configuration file.
Definition: rconfig.cc:1694
uint16 default_config_line
Definition: rconfig.h:164
configuration_manager config
The global configuration manager instance.
Definition: rconfig.cc:3364
std::string rsync_remote_path
Definition: rconfig.h:182
std::vector< std::string > vaults_type
Definition: rconfig.h:234
void parse_vault_overflow_inodes(const std::string &a_value)
Parse a "vault-overflow-inodes" command.
Definition: rconfig.cc:2551
const std::string & link_catalog_dir(void) const
Return the link-catalog-dir path.
Definition: rconfig.cc:1514
void read_job(const std::string &a_path)
Read a job configuration file.
Definition: rconfig.cc:1715
void parse_vault_locking(const std::string &a_value)
Parse a "vault-locking" command.
Definition: rconfig.cc:2587
void parse_vault(const std::string &a_value)
Parse a "vault" command.
Definition: rconfig.cc:2447
void parse_io_poll_interval(const std::string &a_value)
Parse "io-poll-interval" command.
Definition: rconfig.cc:2399
void parse_rsync_options(const std::string &a_value)
Parse an "rsync-options" command.
Definition: rconfig.cc:3168
void parse_error_logging_level(const std::string &a_value)
Parse a "error-loging-level" command.
Definition: rconfig.cc:2321
const job & default_job(void) const
Return the default job configuration.
Definition: rconfig.cc:1658
element_type m_type
Definition: rconfig.h:55
void parse_rsync_local_path(const std::string &a_value)
Parse an "rsync-local-path" command.
Definition: rconfig.cc:2345
const bool use_default(void) const
Return whether or not rvm is to try to read it's default configuration file.
Definition: rconfig.cc:1475
void parse_groupname(const std::string &a_value)
Parse a "groupname" command.
Definition: rconfig.cc:2958
resolution_type
Definition: tstamp.h:16
A configuration manager support class: Used to map rsync exit codes to actions for rvm to take...
Definition: rconfig.h:95
void parse_jobname(const std::string &a_value)
Parse a "jobname" command.
Definition: rconfig.cc:3023
void read_job(const std::string &a_path)
Read a job configuration file, used by the "include" command.
Definition: rconfig.cc:2659
void parse_ssh_options(const std::string &a_value)
Parse an "ssh-options" command.
Definition: rconfig.cc:3182
Keep up with configuration settings for RVM and it's jobs.
Definition: rconfig.h:203
class std::vector< cfgfile_element > cfgfiles_type
Definition: rconfig.h:232
std::string config_path
Definition: rconfig.h:165
const std::vector< std::string > generate_ssh_options_vector(void) const
Generate ssh command line options.
Definition: rconfig.cc:944
const jobs_type & jobs(void) const
Return a list of jobs.
Definition: rconfig.cc:1667
void parse_ssh_local_path(const std::string &a_value)
Parse an "ssh-local-path" command.
Definition: rconfig.cc:2371
void parse_default(const std::string &a_value)
Parse a default job context.
Definition: rconfig.cc:2047
std::string m_link_catalog_dir
Definition: rconfig.h:279
void clear(void)
Clear all values and set the default to "retry".
Definition: rconfig.cc:378
job & operator=(const job &a_job)
Assignment.
Definition: rconfig.cc:633
const element_type & type(void) const
Retrieve the current type.
Definition: rconfig.cc:145
const std::vector< std::string > generate_rsync_options_vector(void) const
Generate rsync command line options.
Definition: rconfig.cc:872
std::vector< std::string > includes_type
Definition: rconfig.h:152
logging_type m_error_logging_level
Definition: rconfig.h:297
const std::string & delete_command_path(void) const
Return the delete-command-path.
Definition: rconfig.cc:1559
rsync_behavior()
C'tor.
Definition: rconfig.cc:403
const overflow_type & vault_overflow_behavior(void) const
Return the vault-overflow-behavior.
Definition: rconfig.cc:1613
rsync_behavior & operator=(const rsync_behavior &a_class)
Assignment.
Definition: rconfig.cc:518
const std::string str(void) const
Construct a string of the current value.
Definition: rconfig.cc:157
archive_path & operator=(const archive_path &a_class)
Assignment.
Definition: rconfig.cc:349
const bool vault_locking(void) const
Return the vault-locking selection.
Definition: rconfig.cc:1649
std::istream * m_in
Definition: rconfig.h:376
void assign(const archive_path_element &a_class)
Assign the value from another archive_path_element instance.
Definition: rconfig.cc:59
std::map< uint16, value_type > map_type
Definition: rconfig.h:106
void reset(void)
Reset to a default value.
Definition: rconfig.cc:225
const logging_type & error_logging_level(void) const
Return the error-logging-level.
Definition: rconfig.cc:1685
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.
Definition: rconfig.cc:2624
void parse_rsync_parallel(const std::string &a_value)
Parse an "rsync-parallel" command.
Definition: rconfig.cc:2384
const logging_type & logging_level(void) const
Return the logging-level.
Definition: rconfig.cc:1676
rsync_connection_type
Definition: rconfig.h:139
bool rsync_multi_hardlink
Definition: rconfig.h:177
const std::string & ssh_local_path(void) const
Return the ssh-local-path.
Definition: rconfig.cc:1568
std::string m_ssh_local_path
Definition: rconfig.h:283
void assign(const uint16 a_code, const value_type a_action)
Assign an action to be taken for a specific exit code.
Definition: rconfig.cc:415
void push_back(const archive_path &a_class)
Add elements to the path list from another archive_path instance.
Definition: rconfig.cc:256
paths_type paths
Definition: rconfig.h:173
const std::string & default_file(void) const
Return the default configuration filename.
Definition: rconfig.cc:1490
void check(void) const
Perform sanity checks on configuration settings.
Definition: rconfig.cc:1379
void parse_log_dir(const std::string &a_value)
Parse a "log-dir" command.
Definition: rconfig.cc:2214
const std::string * m_delimiter
Definition: rconfig.h:378
archive_path_element & operator=(const archive_path_element &a_class)
Assignment.
Definition: rconfig.cc:193
std::string m_delete_command_path
Definition: rconfig.h:282
std::string m_rsync_local_path
Definition: rconfig.h:281
std::string rsync_options
Definition: rconfig.h:179