- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# schroot_base::main Class Reference

Frontend base for schroot programs. More...

`#include <schroot-base-main.h>`

Inheritance diagram for schroot_base::main:

[legend]
Collaboration diagram for schroot_base::main:

[legend]
List of all members.

## Public Member Functions
| main (std::string const &program_name, std::string const &program_usage, options::ptr const &program_options)
| The constructor.
virtual | ~main ()
| The destructor.
int | run (int argc, char *argv[])
| Run the program.
virtual void | action_help (std::ostream &stream)
| Print help information.
virtual void | action_version (std::ostream &stream)
| Print version information.
## Protected Member Functions
virtual int | run_impl ()=0
| Run the program.
## Protected Attributes
std::string | program_name
| The name of the program.
std::string | program_usage
| The usage text of the program.
options::ptr | program_options
| The program options.

## Detailed Description

Frontend base for schroot programs.

This class is used to "run" schroot programs. It contains functionality common to all programs, such as help and version output.

## Constructor & Destructor Documentation

main::main | ( | std::string const & | program_name,
|  | std::string const & | program_usage,
|  | options::ptr const & | program_options |
| ) |  |  |

The constructor.

Parameters:

  | program_name | the program name.
  | program_usage | the program usage message.
  | program_options | the command-line options to use.

main::~main | ( |  | ) | `[virtual]`

The destructor.

Reimplemented in schroot_listmounts::main, schroot::main, schroot_releaselock::main, dchroot::main, and dchroot_dsa::main.

## Member Function Documentation

void main::action_help | ( | std::ostream & | stream | ) | `[virtual]`

Print help information.

Parameters:

  | stream | the stream to output to.

void main::action_version | ( | std::ostream & | stream | ) | `[virtual]`

Print version information.

Parameters:

  | stream | the stream to output to.

int main::run | ( | int | argc,
|  | char * | argv[] |
| ) |  |  |

Run the program.

Parameters:

  | argc | the number of arguments
  | argv | argument vector

Returns:
  0 on success, 1 on failure or the exit status of the chroot command.

virtual int schroot_base::main::run_impl | ( |  | ) | `[protected, pure virtual]`

Run the program.

This is the program-specific run method which must be implemented in a derived class.

Returns:
  0 on success, 1 on failure or the exit status of the chroot command.

Implemented in schroot_listmounts::main, schroot::main_base, and schroot_releaselock::main.

## Member Data Documentation

std::string schroot_base::main::program_name`[protected]`

The name of the program.

options::ptr schroot_base::main::program_options`[protected]`

The program options.

std::string schroot_base::main::program_usage`[protected]`

The usage text of the program.

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

- schroot/schroot-base-main.h
- schroot/schroot-base-main.cc