sbuild  1.7.2
block-device-base.h
1 /* Copyright © 2005-2013 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_FACET_BLOCK_DEVICE_BASE_H
20 #define SBUILD_CHROOT_FACET_BLOCK_DEVICE_BASE_H
21 
22 #include <sbuild/chroot/chroot.h>
23 #include <sbuild/chroot/facet/facet.h>
24 #include <sbuild/chroot/facet/storage.h>
25 
26 namespace sbuild
27 {
28  namespace chroot
29  {
30  namespace facet
31  {
32 
43  class block_device_base : public facet,
44  public storage
45  {
46  public:
49 
50  protected:
53 
56 
57  friend class chroot;
58 
59  public:
61  virtual ~block_device_base ();
62 
63  protected:
64  void
66  bool copy);
67 
68  public:
74  std::string const&
75  get_device () const;
76 
85  void
86  set_device (const std::string& device);
87 
88  virtual std::string
89  get_path () const;
90 
91  virtual void
92  setup_env (environment& env) const;
93 
94  protected:
95  virtual void
96  get_details (format_detail& detail) const;
97 
98  virtual void
99  get_used_keys (string_list& used_keys) const;
100 
101  virtual void
102  get_keyfile (keyfile& keyfile) const;
103 
104  virtual void
105  set_keyfile (const keyfile& keyfile);
106 
108  std::string device;
109  };
110 
111  }
112  }
113 }
114 
115 #endif /* SBUILD_CHROOT_FACET_BLOCK_DEVICE_BASE_H */
116 
117 /*
118  * Local Variables:
119  * mode:C++
120  * End:
121  */
std::string device
The block device to use.
Definition: block-device-base.h:108
block_device_base()
The constructor.
Definition: block-device-base.cc:38
virtual std::string get_path() const
Get the path to the chroot.
Definition: block-device-base.cc:83
Debian source builder components.
Definition: ctty.cc:31
virtual void get_keyfile(keyfile &keyfile) const
Copy the chroot properties into a keyfile.
Definition: block-device-base.cc:116
virtual void get_details(format_detail &detail) const
Get detailed information about the chroot for output.
Definition: block-device-base.cc:103
Chroot storage.
Definition: storage.h:39
Container of environment variables.
Definition: environment.h:38
chroot::error error
Exception type.
Definition: block-device-base.h:48
Common chroot data.
Definition: chroot.h:50
virtual void get_used_keys(string_list &used_keys) const
Get a list of the keys used during keyfile parsing.
Definition: block-device-base.cc:110
virtual void setup_env(environment &env) const
Set environment.
Definition: block-device-base.cc:97
virtual void set_keyfile(const keyfile &keyfile)
Set the chroot properties from a keyfile.
Definition: block-device-base.cc:123
Base class for all facets.
Definition: facet.h:50
std::vector< std::string > string_list
A string vector.
Definition: types.h:38
Custom error.
Definition: custom-error.h:31
Format names and values for output.
Definition: format-detail.h:38
Configuration file parser.
Definition: keyfile.h:46
A base class for block-device chroots.
Definition: block-device-base.h:43
std::string const & get_device() const
Get the block device of the chroot.
Definition: block-device-base.cc:68
void set_chroot(chroot &chroot, bool copy)
Set containing chroot.
Definition: block-device-base.cc:58
void set_device(const std::string &device)
Set the block device of the chroot.
Definition: block-device-base.cc:74
virtual ~block_device_base()
The destructor.
Definition: block-device-base.cc:53