sbuild::ChrootFile Class Reference

A chroot stored in a file archive (tar or zip). More...

#include <sbuild-chroot-file.h>

Inheritance diagram for sbuild::ChrootFile:

Inheritance graph
[legend]
Collaboration diagram for sbuild::ChrootFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~ChrootFile ()
 The destructor.
virtual Chroot::chroot_ptr clone () const
 Copy the chroot.
std::string const & get_file () const
 Get the file used by the chroot.
void set_file (std::string const &file)
 Set the file used by the chroot.
virtual std::string const & get_chroot_type () const
 Get the type of the chroot.
virtual void setup_env (environment &env)
 Set environment.
virtual void setup_lock (SetupType type, bool lock)
virtual SessionFlags get_session_flags () const
 Get the session flags of the chroot.
virtual void print_details (std::ostream &stream) const
 Print detailed information about the chroot to a stream.
virtual void print_config (std::ostream &stream) const
 Print the configuration group for a chroot in the format required by schroot.conf.

Protected Member Functions

 ChrootFile ()
 The constructor.
 ChrootFile (keyfile const &keyfile, std::string const &group)
 The constructor.

Private Attributes

std::string file
 The file to use.

Friends

class Chroot

Detailed Description

A chroot stored in a file archive (tar or zip).

The archive will be unpacked on demand.

Todo:
Optionally mount and then unpack onto a tmpfs, to save using a lot of space under /var. However, this will require careful checking and/or restrictions in order to prevent resource starvation (using all swap space, for example).


Constructor & Destructor Documentation

ChrootFile::ChrootFile  )  [protected]
 

The constructor.

ChrootFile::ChrootFile keyfile const &  keyfile,
std::string const &  group
[protected]
 

The constructor.

Initialise from an open keyfile.

Parameters:
keyfile the configuration file
group the keyfile group (chroot name)

ChrootFile::~ChrootFile  )  [virtual]
 

The destructor.


Member Function Documentation

Chroot::chroot_ptr ChrootFile::clone  )  const [virtual]
 

Copy the chroot.

This is a virtual copy constructor.

Returns:
a shared_ptr to the new copy of the chroot.

Implements sbuild::Chroot.

std::string const & ChrootFile::get_chroot_type  )  const [virtual]
 

Get the type of the chroot.

Returns:
the chroot type.

Implements sbuild::Chroot.

std::string const & ChrootFile::get_file  )  const
 

Get the file used by the chroot.

Returns:
the file.

Chroot::SessionFlags ChrootFile::get_session_flags  )  const [virtual]
 

Get the session flags of the chroot.

These determine how the Session controlling the chroot will operate.

Returns:
the session flags.

Implements sbuild::Chroot.

void ChrootFile::print_config std::ostream &  stream  )  const [virtual]
 

Print the configuration group for a chroot in the format required by schroot.conf.

Parameters:
stream the stream to output to.
Todo:
Replace with proper serialisation code to stream to a keyfile.

Reimplemented from sbuild::Chroot.

void ChrootFile::print_details std::ostream &  stream  )  const [virtual]
 

Print detailed information about the chroot to a stream.

The information is printed in plain text with one line per property.

Parameters:
stream the stream to output to.

Reimplemented from sbuild::Chroot.

void ChrootFile::set_file std::string const &  file  ) 
 

Set the file used by the chroot.

Parameters:
file the file.

void ChrootFile::setup_env environment env  )  [virtual]
 

Set environment.

Set the environment that the setup scripts will see during execution.

Parameters:
env the environment to set.

Reimplemented from sbuild::Chroot.

void ChrootFile::setup_lock SetupType  type,
bool  lock
[virtual]
 


Friends And Related Function Documentation

friend class Chroot [friend]
 


Member Data Documentation

std::string sbuild::ChrootFile::file [private]
 

The file to use.


The documentation for this class was generated from the following files:
Generated on Mon Jan 30 13:23:56 2006 for schroot by  doxygen 1.4.6