schroot::main_base Class Reference

Frontend base for schroot programs. More...

#include <schroot-main-base.h>

Inheritance diagram for schroot::main_base:

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

Collaboration graph
[legend]

List of all members.

Public Types

enum  error_code {
  CHROOTS_NOTFOUND, CHROOT_FILE, CHROOT_FILE2, CHROOT_NOTDEFINED,
  CHROOT_NOTFOUND
}
 Error codes. More...
typedef sbuild::custom_error
< error_code
error
 Exception type.

Public Member Functions

 main_base (std::string const &program_name, std::string const &program_usage, options_base::ptr &options, bool use_syslog)
 The constructor.
virtual ~main_base ()
 The destructor.
virtual void action_list ()=0
 List chroots.
virtual void action_info ()
 Print detailed information about chroots.
virtual void action_location ()
 Print location of chroots.
virtual void action_config ()=0
 Dump configuration file for chroots.

Protected Member Functions

virtual int run_impl ()
 Run the program.
virtual sbuild::string_list get_chroot_options ()
 Get a list of chroots based on the specified options (--all, --chroot).
virtual void compat_check ()
 Check compatibility.
virtual void load_config ()
 Load configuration.
virtual void create_session (sbuild::session::operation sess_op)=0
 Create a session.

Protected Attributes

options_base::ptr options
 The program options.
sbuild::chroot_config::ptr config
 The chroot configuration.
sbuild::string_list chroots
 The chroots to use.
sbuild::session::ptr session
 The session.


Detailed Description

Frontend base for schroot programs.

This class is used to "run" schroot programs. This class contains functionality common to all schroot programs (schroot, dchroot, dchroot-dsa).


Member Typedef Documentation

Exception type.


Member Enumeration Documentation

Error codes.

Enumerator:
CHROOTS_NOTFOUND  Chroots not found.
CHROOT_FILE  No chroots are defined in ....
CHROOT_FILE2  No chroots are defined in ... or ....
CHROOT_NOTDEFINED  The specified chroots are not defined.
CHROOT_NOTFOUND  Chroot not found.


Constructor & Destructor Documentation

main_base::main_base ( std::string const &  program_name,
std::string const &  program_usage,
options_base::ptr options,
bool  use_syslog 
)

The constructor.

Parameters:
program_name the program name.
program_usage the program usage message.
options the command-line options to use.
use_syslog whether to open a connection to the system logger.

main_base::~main_base (  )  [virtual]

The destructor.

Reimplemented in dchroot::main_base.


Member Function Documentation

virtual void schroot::main_base::action_list (  )  [pure virtual]

List chroots.

Implemented in schroot::main, and dchroot::main_base.

Referenced by run_impl().

Here is the caller graph for this function:

void main_base::action_info (  )  [virtual]

Print detailed information about chroots.

References chroots, and config.

Referenced by run_impl().

Here is the caller graph for this function:

void main_base::action_location (  )  [virtual]

Print location of chroots.

Reimplemented in dchroot::main.

References chroots, and config.

Referenced by run_impl().

Here is the caller graph for this function:

virtual void schroot::main_base::action_config (  )  [pure virtual]

Dump configuration file for chroots.

Implemented in schroot::main, and dchroot::main_base.

Referenced by run_impl().

Here is the caller graph for this function:

int main_base::run_impl (  )  [protected, virtual]

sbuild::string_list main_base::get_chroot_options (  )  [protected, virtual]

Get a list of chroots based on the specified options (--all, --chroot).

Returns:
a list of chroots.

References CHROOT_NOTFOUND, CHROOTS_NOTFOUND, and config.

Referenced by run_impl().

Here is the caller graph for this function:

void main_base::compat_check (  )  [protected, virtual]

Check compatibility.

Does nothing, but derived classes may use it as they see fit.

Reimplemented in dchroot::main_base.

Referenced by run_impl().

Here is the caller graph for this function:

void main_base::load_config (  )  [protected, virtual]

Load configuration.

Reimplemented in dchroot::main, and dchroot_dsa::main.

References config.

Referenced by dchroot::main::load_config(), dchroot_dsa::main::load_config(), and run_impl().

Here is the caller graph for this function:

virtual void schroot::main_base::create_session ( sbuild::session::operation  sess_op  )  [protected, pure virtual]

Create a session.

This sets the session member.

Parameters:
sess_op the session operation to perform.

Implemented in schroot::main, dchroot::main, and dchroot_dsa::main.

Referenced by run_impl().

Here is the caller graph for this function:


Member Data Documentation

The program options.

The session.

Referenced by schroot::main::create_session(), and run_impl().


The documentation for this class was generated from the following files:

Generated on Sat Jul 5 12:01:17 2008 for schroot by  doxygen 1.5.6