sbuild  1.7.2
mountable.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_MOUNTABLE_H
20 #define SBUILD_CHROOT_FACET_MOUNTABLE_H
21 
22 #include <sbuild/chroot/facet/facet.h>
23 
24 namespace sbuild
25 {
26  namespace chroot
27  {
28  namespace facet
29  {
30 
42  class mountable : public facet
43  {
44  public:
46  typedef std::shared_ptr<mountable> ptr;
47 
49  typedef std::shared_ptr<const mountable> const_ptr;
50 
51  private:
53  mountable ();
54 
55  public:
57  virtual ~mountable ();
58 
64  static ptr
65  create ();
66 
67  virtual facet::ptr
68  clone () const;
69 
70  virtual std::string const&
71  get_name () const;
72 
78  virtual std::string const&
79  get_mount_device () const;
80 
86  virtual void
87  set_mount_device (const std::string& mount_device);
88 
94  virtual std::string const&
95  get_mount_options () const;
96 
102  virtual void
103  set_mount_options (const std::string& mount_options);
104 
111  virtual std::string const&
112  get_location () const;
113 
120  virtual void
121  set_location (const std::string& location);
122 
123  virtual void
124  setup_env (environment& env) const;
125 
126  virtual void
127  get_details (format_detail& detail) const;
128 
129  virtual void
130  get_used_keys (string_list& used_keys) const;
131 
132  virtual void
133  get_keyfile (keyfile& keyfile) const;
134 
135  virtual void
136  set_keyfile (const keyfile& keyfile);
137 
138  private:
140  std::string mount_device;
142  std::string mount_options;
144  std::string location;
145  };
146 
147  }
148  }
149 }
150 
151 #endif /* SBUILD_CHROOT_FACET_MOUNTABLE_H */
152 
153 /*
154  * Local Variables:
155  * mode:C++
156  * End:
157  */
virtual void get_used_keys(string_list &used_keys) const
Get a list of the keys used during keyfile parsing.
Definition: mountable.cc:144
std::string location
Location inside the mount location root.
Definition: mountable.h:144
virtual void set_mount_device(const std::string &mount_device)
Set the device path of the chroot block device to mount.
Definition: mountable.cc:92
static ptr create()
Create a chroot facet.
Definition: mountable.cc:68
Debian source builder components.
Definition: ctty.cc:31
virtual std::string const & get_location() const
Get the location.
Definition: mountable.cc:110
virtual void get_details(format_detail &detail) const
Get detailed information about the chroot for output.
Definition: mountable.cc:133
virtual facet::ptr clone() const
Copy the chroot facet.
Definition: mountable.cc:74
Container of environment variables.
Definition: environment.h:38
virtual void setup_env(environment &env) const
Set environment.
Definition: mountable.cc:125
virtual ~mountable()
The destructor.
Definition: mountable.cc:63
Chroot support for mountable devices and filesystems.
Definition: mountable.h:42
std::string mount_device
The device to mount.
Definition: mountable.h:140
Base class for all facets.
Definition: facet.h:50
std::vector< std::string > string_list
A string vector.
Definition: types.h:38
std::string mount_options
The options to mount the device with.
Definition: mountable.h:142
virtual void set_mount_options(const std::string &mount_options)
Set the filesystem mount options of the chroot block device.
Definition: mountable.cc:104
Format names and values for output.
Definition: format-detail.h:38
virtual std::string const & get_mount_options() const
Get the filesystem mount options of the chroot block device.
Definition: mountable.cc:98
virtual void get_keyfile(keyfile &keyfile) const
Copy the chroot properties into a keyfile.
Definition: mountable.cc:152
Configuration file parser.
Definition: keyfile.h:46
virtual void set_keyfile(const keyfile &keyfile)
Set the chroot properties from a keyfile.
Definition: mountable.cc:171
mountable()
The constructor.
Definition: mountable.cc:55
std::shared_ptr< facet > ptr
A shared_ptr to a chroot facet object.
Definition: facet.h:63
std::shared_ptr< const mountable > const_ptr
A shared_ptr to a const chroot facet object.
Definition: mountable.h:49
virtual std::string const & get_mount_device() const
Get the device path of the chroot block device to mount.
Definition: mountable.cc:86
std::shared_ptr< mountable > ptr
A shared_ptr to a chroot facet object.
Definition: mountable.h:46
virtual void set_location(const std::string &location)
Set the location.
Definition: mountable.cc:116
virtual std::string const & get_name() const
Get the name of the chroot facet.
Definition: mountable.cc:80