sbuild  1.7.1
fsunion.h
1 /* Copyright © 2008-2013 Jan-Marek Glogowski <glogow@fbihome.de>
2  * Copyright © 2005-2013 Roger Leigh <rleigh@debian.org>
3  *
4  * schroot is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * schroot is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see
16  * <http://www.gnu.org/licenses/>.
17  *
18  *********************************************************************/
19 
20 #ifndef SBUILD_CHROOT_FACET_FSUNION_H
21 #define SBUILD_CHROOT_FACET_FSUNION_H
22 
23 #include <sbuild/chroot/chroot.h>
24 #include <sbuild/chroot/facet/facet.h>
25 #include <sbuild/chroot/facet/session-setup.h>
26 #include <sbuild/chroot/facet/source-setup.h>
27 
28 namespace sbuild
29 {
30  namespace chroot
31  {
32  namespace facet
33  {
34 
44  class fsunion : public facet,
45  public session_setup,
46  public source_setup
47  {
48  public:
51  {
55  };
56 
59 
61  typedef std::shared_ptr<fsunion> ptr;
62 
64  typedef std::shared_ptr<const fsunion> const_ptr;
65 
66  private:
68  fsunion ();
69 
70  public:
72  virtual ~fsunion ();
73 
79  static ptr
80  create ();
81 
82  virtual facet::ptr
83  clone () const;
84 
85  std::string const&
86  get_name () const;
87 
93  bool
94  get_union_configured () const;
95 
102  virtual std::string const&
103  get_union_type () const;
104 
112  virtual void
113  set_union_type (const std::string& union_type);
114 
121  virtual std::string const&
122  get_union_mount_options () const;
123 
136  virtual void
137  set_union_mount_options (const std::string& union_mount_options);
138 
144  virtual std::string const&
146 
152  virtual void
153  set_union_overlay_directory (const std::string& directory);
154 
160  virtual std::string const&
162 
168  virtual void
169  set_union_underlay_directory (const std::string& directory);
170 
171  virtual void
172  setup_env (environment& env) const;
173 
174  virtual session_flags
175  get_session_flags () const;
176 
177  virtual void
178  get_details (format_detail& detail) const;
179 
180  virtual void
181  get_used_keys (string_list& used_keys) const;
182 
183  virtual void
184  get_keyfile (keyfile& keyfile) const;
185 
186  virtual void
187  set_keyfile (const keyfile& keyfile);
188 
189  virtual void
190  chroot_session_setup (const chroot& parent,
191  const std::string& session_id,
192  const std::string& alias,
193  const std::string& user,
194  bool root);
195 
196  virtual void
197  chroot_source_setup (const chroot& parent);
198 
199  private:
201  std::string union_type;
203  std::string union_mount_options;
208  };
209 
210  }
211  }
212 }
213 
214 #endif /* SBUILD_CHROOT_FACET_FSUNION_H */
215 
216 /*
217  * Local Variables:
218  * mode:C++
219  * End:
220  */