A configuration manager support class: Used to map rsync exit codes to actions for rvm to take. More...
#include <rconfig.h>
Public Types | |
enum | behavior_type { quit, fail, retry, retry_without_hardlinks, ok } |
typedef behavior_type | value_type |
typedef std::map< uint16, value_type > | map_type |
Public Member Functions | |
void | clear (void) |
Clear all values and set the default to "retry". | |
void | reset (void) |
Clear all values and set some sane default actions. | |
rsync_behavior () | |
C'tor. | |
rsync_behavior (const rsync_behavior &a_class) | |
C'tor. | |
void | assign (const uint16 a_code, const value_type a_action) |
Assign an action to be taken for a specific exit code. | |
void | assign (const rsync_behavior &a_class) |
Assign actions to be taken from another rsync_behavior instance. | |
void | assign (const std::string &a_str) |
Assign actions to be taken from a string (parse a string in the form of exit-code '=' action). | |
const value_type | operator[] (const uint16 a_code) const |
Return the action to be taken for a given exit code. | |
value_type & | operator[] (const uint16 a_code) |
Return the action to be taken for a given exit code. | |
rsync_behavior & | operator= (const rsync_behavior &a_class) |
Assignment. | |
rsync_behavior & | operator= (const value_type a_enum) |
Assignment. | |
rsync_behavior & | operator= (const std::string &a_str) |
Assignment. | |
const value_type | default_value (void) const |
Return the default action. | |
const map_type & | map_value (void) const |
Return an std::map of exit codes to actions. | |
Static Public Attributes | |
static const uint16 | default_behavior = ((uint16)-1) |
Default behavior. | |
Private Attributes | |
map_type | m_map |
value_type | m_default |
A configuration manager support class: Used to map rsync exit codes to actions for rvm to take.
Definition at line 95 of file rconfig.h.
typedef std::map<uint16, value_type> rsync_behavior::map_type |
rsync_behavior::rsync_behavior | ( | ) |
C'tor.
Definition at line 403 of file rconfig.cc.
References reset().
rsync_behavior::rsync_behavior | ( | const rsync_behavior & | a_class | ) |
C'tor.
Definition at line 409 of file rconfig.cc.
References assign().
void rsync_behavior::assign | ( | const std::string & | a_str | ) |
Assign actions to be taken from a string (parse a string in the form of exit-code '=' action).
Definition at line 439 of file rconfig.cc.
References assign(), default_behavior, ERROR, fail, ok, quit, retry, retry_without_hardlinks, and TRY_nomem.
void rsync_behavior::assign | ( | const rsync_behavior & | a_class | ) |
Assign actions to be taken from another rsync_behavior instance.
Definition at line 425 of file rconfig.cc.
References clear(), default_value(), m_default, m_map, map_value(), and TRY_nomem.
void rsync_behavior::assign | ( | const uint16 | a_code, | |
const value_type | a_action | |||
) |
Assign an action to be taken for a specific exit code.
Definition at line 415 of file rconfig.cc.
References default_behavior, m_default, m_map, and TRY_nomem.
Referenced by assign(), operator=(), and rsync_behavior().
void rsync_behavior::clear | ( | void | ) |
Clear all values and set the default to "retry".
Definition at line 378 of file rconfig.cc.
References m_default, m_map, and retry.
Referenced by assign(), job_parser::parse_clear(), and reset().
const rsync_behavior::behavior_type rsync_behavior::default_value | ( | void | ) | const |
const rsync_behavior::map_type & rsync_behavior::map_value | ( | void | ) | const |
Return an std::map of exit codes to actions.
Definition at line 549 of file rconfig.cc.
References m_map.
rsync_behavior & rsync_behavior::operator= | ( | const std::string & | a_str | ) |
Assignment.
Definition at line 535 of file rconfig.cc.
References assign().
rsync_behavior & rsync_behavior::operator= | ( | const value_type | a_enum | ) |
Assignment.
Definition at line 527 of file rconfig.cc.
References assign(), and default_behavior.
rsync_behavior & rsync_behavior::operator= | ( | const rsync_behavior & | a_class | ) |
Assignment.
Definition at line 518 of file rconfig.cc.
References assign().
rsync_behavior::value_type & rsync_behavior::operator[] | ( | const uint16 | a_code | ) |
Return the action to be taken for a given exit code.
Definition at line 509 of file rconfig.cc.
References default_behavior, m_default, and m_map.
const rsync_behavior::value_type rsync_behavior::operator[] | ( | const uint16 | a_code | ) | const |
Return the action to be taken for a given exit code.
Definition at line 496 of file rconfig.cc.
References default_behavior, m_default, and m_map.
void rsync_behavior::reset | ( | void | ) |
Clear all values and set some sane default actions.
Definition at line 385 of file rconfig.cc.
References clear(), fail, m_default, m_map, ok, retry, retry_without_hardlinks, and TRY_nomem.
Referenced by rsync_behavior().
const uint16 rsync_behavior::default_behavior = ((uint16)-1) [static] |
Default behavior.
Definition at line 107 of file rconfig.h.
Referenced by assign(), operator=(), and operator[]().
value_type rsync_behavior::m_default [private] |
Definition at line 130 of file rconfig.h.
Referenced by assign(), clear(), default_value(), operator[](), and reset().
map_type rsync_behavior::m_map [private] |
Definition at line 129 of file rconfig.h.
Referenced by assign(), clear(), map_value(), operator[](), and reset().