sbuild  1.6.10
sbuild-chroot-facet-mountable.h
1 /* Copyright © 2005-2009 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/sbuild-chroot-facet.h>
23 
24 namespace sbuild
25 {
26 
39  {
40  public:
42  typedef std::shared_ptr<chroot_facet_mountable> ptr;
43 
45  typedef std::shared_ptr<const chroot_facet_mountable> const_ptr;
46 
47  private:
50 
51  public:
53  virtual ~chroot_facet_mountable ();
54 
60  static ptr
61  create ();
62 
63  virtual chroot_facet::ptr
64  clone () const;
65 
66  virtual std::string const&
67  get_name () const;
68 
74  virtual std::string const&
75  get_mount_device () const;
76 
82  virtual void
83  set_mount_device (std::string const& mount_device);
84 
90  virtual std::string const&
91  get_mount_options () const;
92 
98  virtual void
99  set_mount_options (std::string const& mount_options);
100 
107  virtual std::string const&
108  get_location () const;
109 
116  virtual void
117  set_location (std::string const& location);
118 
119  virtual void
120  setup_env (chroot const& chroot,
121  environment& env) const;
122 
123  virtual chroot::session_flags
124  get_session_flags (chroot const& chroot) const;
125 
126  virtual void
127  get_details (chroot const& chroot,
128  format_detail& detail) const;
129 
130  virtual void
131  get_keyfile (chroot const& chroot,
132  keyfile& keyfile) const;
133 
134  virtual void
136  keyfile const& keyfile,
137  string_list& used_keys);
138 
139  private:
141  std::string mount_device;
143  std::string mount_options;
145  std::string location;
146  };
147 
148 }
149 
150 #endif /* SBUILD_CHROOT_FACET_MOUNTABLE_H */
151 
152 /*
153  * Local Variables:
154  * mode:C++
155  * End:
156  */
std::shared_ptr< const chroot_facet_mountable > const_ptr
A shared_ptr to a const chroot facet object.
Definition: sbuild-chroot-facet-mountable.h:45
virtual ~chroot_facet_mountable()
The destructor.
Definition: sbuild-chroot-facet-mountable.cc:41
std::string location
Location inside the mount location root.
Definition: sbuild-chroot-facet-mountable.h:145
virtual std::string const & get_mount_options() const
Get the filesystem mount options of the chroot block device.
Definition: sbuild-chroot-facet-mountable.cc:78
Debian source builder components.
Definition: sbuild-auth-null.h:24
chroot_facet_mountable()
The constructor.
Definition: sbuild-chroot-facet-mountable.cc:33
virtual void set_mount_options(std::string const &mount_options)
Set the filesystem mount options of the chroot block device.
Definition: sbuild-chroot-facet-mountable.cc:84
std::string mount_options
The options to mount the device with.
Definition: sbuild-chroot-facet-mountable.h:143
virtual chroot_facet::ptr clone() const
Copy the chroot facet.
Definition: sbuild-chroot-facet-mountable.cc:52
virtual void set_keyfile(chroot &chroot, keyfile const &keyfile, string_list &used_keys)
Set the chroot properties from a keyfile.
Definition: sbuild-chroot-facet-mountable.cc:152
virtual std::string const & get_location() const
Get the location.
Definition: sbuild-chroot-facet-mountable.cc:90
Container of environment variables.
Definition: sbuild-environment.h:38
Configuration file parser.
Definition: sbuild-basic-keyfile.h:138
Chroot support for mountable devices and filesystems.
Definition: sbuild-chroot-facet-mountable.h:38
virtual chroot::session_flags get_session_flags(chroot const &chroot) const
Get the session flags of the chroot.
Definition: sbuild-chroot-facet-mountable.cc:114
virtual void set_mount_device(std::string const &mount_device)
Set the device path of the chroot block device to mount.
Definition: sbuild-chroot-facet-mountable.cc:72
std::vector< std::string > string_list
A string vector.
Definition: sbuild-types.h:38
static ptr create()
Create a chroot facet.
Definition: sbuild-chroot-facet-mountable.cc:46
virtual void get_details(chroot const &chroot, format_detail &detail) const
Get detailed information about the chroot for output.
Definition: sbuild-chroot-facet-mountable.cc:120
virtual void set_location(std::string const &location)
Set the location.
Definition: sbuild-chroot-facet-mountable.cc:96
session_flags
Chroot session properties.
Definition: sbuild-chroot.h:57
std::shared_ptr< chroot_facet > ptr
A shared_ptr to a chroot facet object.
Definition: sbuild-chroot-facet.h:44
Format names and values for output.
Definition: sbuild-format-detail.h:38
virtual void setup_env(chroot const &chroot, environment &env) const
Set environment.
Definition: sbuild-chroot-facet-mountable.cc:105
std::string mount_device
The device to mount.
Definition: sbuild-chroot-facet-mountable.h:141
std::shared_ptr< chroot_facet_mountable > ptr
A shared_ptr to a chroot facet object.
Definition: sbuild-chroot-facet-mountable.h:42
Common chroot data.
Definition: sbuild-chroot.h:45
virtual std::string const & get_name() const
Get the name of the chroot facet.
Definition: sbuild-chroot-facet-mountable.cc:58
virtual void get_keyfile(chroot const &chroot, keyfile &keyfile) const
Copy the chroot properties into a keyfile.
Definition: sbuild-chroot-facet-mountable.cc:132
virtual std::string const & get_mount_device() const
Get the device path of the chroot block device to mount.
Definition: sbuild-chroot-facet-mountable.cc:66
Common chroot data.
Definition: sbuild-chroot-facet.h:40