sbuild  1.6.10
sbuild-chroot-block-device-base.h
1 /* Copyright © 2005-2008 Roger Leigh <rleigh@debian.org>
2  *
3  * schroot is free software: you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * schroot is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  *********************************************************************/
18 
19 #ifndef SBUILD_CHROOT_BLOCK_DEVICE_BASE_H
20 #define SBUILD_CHROOT_BLOCK_DEVICE_BASE_H
21 
22 #include <sbuild/sbuild-chroot.h>
23 
24 namespace sbuild
25 {
26 
38  {
39  protected:
42 
45 
46  friend class chroot;
47 
48  public:
50  virtual ~chroot_block_device_base ();
51 
57  std::string const&
58  get_device () const;
59 
68  void
69  set_device (std::string const& device);
70 
71  virtual std::string
72  get_path () const;
73 
74  virtual void
75  setup_env (chroot const& chroot,
76  environment& env) const;
77 
78  virtual session_flags
79  get_session_flags (chroot const& chroot) const;
80 
81  protected:
82  virtual void
83  get_details (chroot const& chroot,
84  format_detail& detail) const;
85 
86  virtual void
87  get_keyfile (chroot const& chroot,
88  keyfile& keyfile) const;
89 
90  virtual void
91  set_keyfile (chroot& chroot,
92  keyfile const& keyfile,
93  string_list& used_keys);
94 
96  std::string device;
97  };
98 
99 }
100 
101 #endif /* SBUILD_CHROOT_BLOCK_DEVICE_BASE_H */
102 
103 /*
104  * Local Variables:
105  * mode:C++
106  * End:
107  */
virtual void get_details(chroot const &chroot, format_detail &detail) const
Get detailed information about the chroot for output.
Definition: sbuild-chroot-block-device-base.cc:99
Debian source builder components.
Definition: sbuild-auth-null.h:24
chroot_block_device_base()
The constructor.
Definition: sbuild-chroot-block-device-base.cc:36
std::string device
The block device to use.
Definition: sbuild-chroot-block-device-base.h:96
Container of environment variables.
Definition: sbuild-environment.h:38
Configuration file parser.
Definition: sbuild-basic-keyfile.h:138
A base class for block-device chroots.
Definition: sbuild-chroot-block-device-base.h:37
void set_device(std::string const &device)
Set the block device of the chroot.
Definition: sbuild-chroot-block-device-base.cc:61
std::vector< std::string > string_list
A string vector.
Definition: sbuild-types.h:38
virtual void set_keyfile(chroot &chroot, keyfile const &keyfile, string_list &used_keys)
Set the chroot properties from a keyfile.
Definition: sbuild-chroot-block-device-base.cc:119
virtual void get_keyfile(chroot const &chroot, keyfile &keyfile) const
Copy the chroot properties into a keyfile.
Definition: sbuild-chroot-block-device-base.cc:109
session_flags get_session_flags() const
Get the session flags of the chroot.
Definition: sbuild-chroot.cc:638
session_flags
Chroot session properties.
Definition: sbuild-chroot.h:57
Format names and values for output.
Definition: sbuild-format-detail.h:38
Common chroot data.
Definition: sbuild-chroot.h:45
virtual ~chroot_block_device_base()
The destructor.
Definition: sbuild-chroot-block-device-base.cc:50
std::string const & get_device() const
Get the block device of the chroot.
Definition: sbuild-chroot-block-device-base.cc:55
virtual std::string get_path() const
Get the path to the chroot.
Definition: sbuild-chroot-block-device-base.cc:70
virtual void setup_env(chroot const &chroot, environment &env) const
Set environment.
Definition: sbuild-chroot-block-device-base.cc:84