#include <schroot-base-option-action.h>
Collaboration diagram for schroot_base::option_action:
Public Types | |
typedef std::string | action_type |
Public Member Functions | |
option_action () | |
The constructor. | |
virtual | ~option_action () |
The destructor. | |
void | add (action_type const &action) |
Add an action. | |
action_type const & | get_default () |
void | set_default (action_type const &action) |
Set the default action. | |
action_type const & | get () |
void | set (action_type const &action) |
Set the action to perform. | |
bool | valid (action_type const &action) |
Check if an action is valid. | |
option_action & | operator= (action_type const &action) |
bool | operator== (action_type const &action) |
bool | operator!= (action_type const &action) |
Private Types | |
typedef std::set< std::string > | action_set |
The container of the actions. | |
Private Attributes | |
std::string | default_action |
Default action. | |
std::string | current_action |
Current action. | |
action_set | actions |
Allowed actions. |
This class contains all allowed options. This replaced the use of enums to allow extension of the options by inheritance.
Definition at line 37 of file schroot-base-option-action.h.
typedef std::string schroot_base::option_action::action_type |
Definition at line 40 of file schroot-base-option-action.h.
typedef std::set<std::string> schroot_base::option_action::action_set [private] |
option_action::option_action | ( | ) |
option_action::~option_action | ( | ) | [virtual] |
void option_action::add | ( | action_type const & | action | ) |
Add an action.
The specified action is added to the list of permitted actions.
action | the action to add. |
Definition at line 49 of file schroot-base-option-action.cc.
References actions.
Referenced by schroot_base::options::add_options().
Here is the caller graph for this function:
option_action::action_type const & option_action::get_default | ( | ) |
void option_action::set_default | ( | action_type const & | action | ) |
Set the default action.
action | the action to set. |
Definition at line 61 of file schroot-base-option-action.cc.
References default_action, and valid().
option_action::action_type const & option_action::get | ( | ) |
Definition at line 70 of file schroot-base-option-action.cc.
References current_action, and default_action.
void option_action::set | ( | action_type const & | action | ) |
Set the action to perform.
This detects if an action has already been set (only one action may be specified at once).
action | the action to set. |
Definition at line 79 of file schroot-base-option-action.cc.
References current_action, and valid().
bool option_action::valid | ( | action_type const & | action | ) |
Check if an action is valid.
action | the action to check. |
Definition at line 93 of file schroot-base-option-action.cc.
References actions.
Referenced by set(), and set_default().
Here is the caller graph for this function:
option_action& schroot_base::option_action::operator= | ( | action_type const & | action | ) | [inline] |
Definition at line 97 of file schroot-base-option-action.h.
bool schroot_base::option_action::operator== | ( | action_type const & | action | ) | [inline] |
Definition at line 103 of file schroot-base-option-action.h.
bool schroot_base::option_action::operator!= | ( | action_type const & | action | ) | [inline] |
Definition at line 111 of file schroot-base-option-action.h.
std::string schroot_base::option_action::default_action [private] |
Default action.
Definition at line 121 of file schroot-base-option-action.h.
Referenced by get(), get_default(), and set_default().
std::string schroot_base::option_action::current_action [private] |