schroot::options_base Class Reference

Basic schroot command-line options. More...

#include <schroot-options-base.h>

Inheritance diagram for schroot::options_base:

Inheritance graph
[legend]
Collaboration diagram for schroot::options_base:

Collaboration graph
[legend]
List of all members.

Public Types

enum  action_type {
  ACTION_SESSION_AUTO, ACTION_SESSION_BEGIN, ACTION_SESSION_RECOVER, ACTION_SESSION_RUN,
  ACTION_SESSION_END, ACTION_HELP, ACTION_VERSION, ACTION_LIST,
  ACTION_INFO, ACTION_LOCATION, ACTION_CONFIG
}
 The action to perform. More...
typedef std::tr1::shared_ptr<
options_base
ptr
 A shared_ptr to an options_base object.

Public Member Functions

 options_base ()
 The constructor.
virtual ~options_base ()
 The destructor.

Public Attributes

action_type action
 The action to perform.
sbuild::string_list chroots
 Chroots to use.
std::string chroot_path
 Chroot to print path.
sbuild::string_list command
 Command to run.
std::string directory
 Directory to use.
std::string user
 User to run as.
bool preserve
 Preserve environment.
bool all
 Use all chroots and sessions.
bool all_chroots
 Use all chroots.
bool all_sessions
 Use all sessions.
bool load_chroots
 Load chroots.
bool load_sessions
 Load sessions.
bool session_force
 Force session operations.

Protected Member Functions

void set_action (action_type action)
 Set action.
bool all_used () const
 Check if any of the --all options have been used.
virtual void add_options ()
 Add options to option groups.
virtual void add_option_groups ()
 Add option groups to container groups.
virtual void check_options ()
 Check options after parsing.
virtual void check_actions ()
 Check actions after parsing.

Protected Attributes

boost::program_options::options_description chroot
 Chroot options group.
boost::program_options::options_description chrootenv
 Chroot environment options group.
boost::program_options::options_description session
 Session options group.

Detailed Description

Basic schroot command-line options.

This is specialised by the frontends to suit their particular command-line options and behaviour. This class contains functionality and options common to all schroot programs (schroot, dchroot, dchroot-dsa).

Definition at line 50 of file schroot-options-base.h.


Member Typedef Documentation

typedef std::tr1::shared_ptr<options_base> schroot::options_base::ptr

A shared_ptr to an options_base object.

Reimplemented from schroot_base::options.

Definition at line 70 of file schroot-options-base.h.


Member Enumeration Documentation

enum schroot::options_base::action_type

The action to perform.

Enumerator:
ACTION_SESSION_AUTO  Begin, run and end a session.
ACTION_SESSION_BEGIN  Begin a session.
ACTION_SESSION_RECOVER  Recover an existing session.
ACTION_SESSION_RUN  Run an existing session.
ACTION_SESSION_END  End an existing session.
ACTION_HELP  Display program help.
ACTION_VERSION  Display program version.
ACTION_LIST  Display a list of chroots.
ACTION_INFO  Display chroot information.
ACTION_LOCATION  Display chroot location information.
ACTION_CONFIG  Display chroot configuration.

Definition at line 54 of file schroot-options-base.h.


Constructor & Destructor Documentation

options_base::options_base (  ) 

The constructor.

Definition at line 35 of file schroot-options-base.cc.

options_base::~options_base (  )  [virtual]

The destructor.

Definition at line 52 of file schroot-options-base.cc.


Member Function Documentation

void options_base::set_action ( action_type  action  )  [protected]

Set action.

This detects if an action has already been set (only one action may be specified at once).

Parameters:
action the action to set.

Definition at line 223 of file schroot-options-base.cc.

References _, and ACTION_SESSION_AUTO.

Referenced by schroot::options::check_options(), check_options(), dchroot::options::check_options(), and dchroot_dsa::options::check_options().

Here is the caller graph for this function:

bool schroot::options_base::all_used (  )  const [inline, protected]

Check if any of the --all options have been used.

Returns:
true if any of the options have been used, otherwise false.

Definition at line 122 of file schroot-options-base.h.

Referenced by check_actions(), dchroot::options::check_options(), and dchroot_dsa::options::check_options().

Here is the caller graph for this function:

void options_base::add_options (  )  [protected, virtual]

Add options to option groups.

Reimplemented from schroot_base::options.

Reimplemented in schroot::options, dchroot::options, and dchroot_dsa::options.

Definition at line 57 of file schroot-options-base.cc.

References _, schroot_base::options::add_options(), chroot, chroots, command, schroot_base::options::general, schroot_base::options::hidden, and schroot_base::options::positional.

Referenced by schroot::options::add_options(), dchroot::options::add_options(), and dchroot_dsa::options::add_options().

Here is the call graph for this function:

Here is the caller graph for this function:

void options_base::add_option_groups (  )  [protected, virtual]

Add option groups to container groups.

Reimplemented from schroot_base::options.

Definition at line 81 of file schroot-options-base.cc.

References schroot_base::options::add_option_groups(), chroot, chrootenv, schroot_base::options::global, session, and schroot_base::options::visible.

Here is the call graph for this function:

void options_base::check_options (  )  [protected, virtual]

Check options after parsing.

Reimplemented from schroot_base::options.

Reimplemented in schroot::options, dchroot::options, and dchroot_dsa::options.

Definition at line 115 of file schroot-options-base.cc.

References ACTION_CONFIG, ACTION_HELP, ACTION_INFO, ACTION_LIST, ACTION_VERSION, schroot_base::options::check_options(), set_action(), and schroot_base::options::vm.

Referenced by schroot::options::check_options(), dchroot::options::check_options(), and dchroot_dsa::options::check_options().

Here is the call graph for this function:

Here is the caller graph for this function:

void options_base::check_actions (  )  [protected, virtual]

Check actions after parsing.

Reimplemented from schroot_base::options.

Definition at line 132 of file schroot-options-base.cc.

References _, ACTION_CONFIG, ACTION_HELP, ACTION_INFO, ACTION_LIST, ACTION_LOCATION, ACTION_SESSION_AUTO, ACTION_SESSION_BEGIN, ACTION_SESSION_END, ACTION_SESSION_RECOVER, ACTION_SESSION_RUN, ACTION_VERSION, all, all_chroots, all_sessions, all_used(), load_chroots, load_sessions, sbuild::log_info(), and sbuild::log_warning().

Here is the call graph for this function:


Member Data Documentation

action_type schroot::options_base::action

The action to perform.

Definition at line 79 of file schroot-options-base.h.

Referenced by dchroot_dsa::options::check_options().

sbuild::string_list schroot::options_base::chroots

Chroots to use.

Definition at line 81 of file schroot-options-base.h.

Referenced by add_options().

std::string schroot::options_base::chroot_path

Chroot to print path.

Definition at line 83 of file schroot-options-base.h.

Referenced by dchroot::options::add_options().

sbuild::string_list schroot::options_base::command

Command to run.

Definition at line 85 of file schroot-options-base.h.

Referenced by add_options(), and dchroot_dsa::options::check_options().

std::string schroot::options_base::directory

Directory to use.

Definition at line 87 of file schroot-options-base.h.

Referenced by schroot::options::add_options(), dchroot::options::add_options(), and dchroot_dsa::options::add_options().

std::string schroot::options_base::user

User to run as.

Definition at line 89 of file schroot-options-base.h.

bool schroot::options_base::preserve

Preserve environment.

Definition at line 91 of file schroot-options-base.h.

Referenced by dchroot_dsa::options::check_options().

bool schroot::options_base::all

Use all chroots and sessions.

Definition at line 93 of file schroot-options-base.h.

Referenced by check_actions(), and dchroot::options::check_options().

bool schroot::options_base::all_chroots

Use all chroots.

Definition at line 95 of file schroot-options-base.h.

Referenced by check_actions(), schroot::options::check_options(), and dchroot::options::check_options().

bool schroot::options_base::all_sessions

Use all sessions.

Definition at line 97 of file schroot-options-base.h.

Referenced by check_actions(), schroot::options::check_options(), and dchroot::options::check_options().

bool schroot::options_base::load_chroots

Load chroots.

Definition at line 99 of file schroot-options-base.h.

Referenced by check_actions().

bool schroot::options_base::load_sessions

Load sessions.

Definition at line 101 of file schroot-options-base.h.

Referenced by check_actions().

bool schroot::options_base::session_force

Force session operations.

Definition at line 103 of file schroot-options-base.h.

boost::program_options::options_description schroot::options_base::chroot [protected]

Chroot options group.

Definition at line 140 of file schroot-options-base.h.

Referenced by add_option_groups(), schroot::options::add_options(), add_options(), dchroot::options::add_options(), and dchroot_dsa::options::add_options().

boost::program_options::options_description schroot::options_base::chrootenv [protected]

Chroot environment options group.

Definition at line 142 of file schroot-options-base.h.

Referenced by add_option_groups(), schroot::options::add_options(), dchroot::options::add_options(), and dchroot_dsa::options::add_options().

boost::program_options::options_description schroot::options_base::session [protected]

Session options group.

Definition at line 144 of file schroot-options-base.h.

Referenced by add_option_groups(), and schroot::options::add_options().


The documentation for this class was generated from the following files:
Generated on Sat Jan 27 16:14:53 2007 for schroot by  doxygen 1.5.1