sbuild  1.6.0
sbuild-chroot-loopback.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_LOOPBACK_H
20 #define SBUILD_CHROOT_LOOPBACK_H
21 
22 #include <sbuild/sbuild-config.h>
23 #include <sbuild/sbuild-chroot.h>
24 
25 namespace sbuild
26 {
27 
33  class chroot_loopback : public chroot
34  {
35  public:
38 
39  protected:
41  chroot_loopback ();
42 
44  chroot_loopback (const chroot_loopback& rhs);
45 
46  friend class chroot;
47 
48  public:
50  virtual ~chroot_loopback ();
51 
52  virtual chroot::ptr
53  clone () const;
54 
55  virtual chroot::ptr
56  clone_session (std::string const& session_id,
57  std::string const& alias,
58  std::string const& user,
59  bool root) const;
60 
61  virtual chroot::ptr
62  clone_source () const;
63 
69  std::string const&
70  get_file () const;
71 
77  void
78  set_file (std::string const& file);
79 
80  std::string const&
81  get_chroot_type () const;
82 
83  virtual std::string
84  get_path () const;
85 
86  virtual void
87  setup_env (chroot const& chroot,
88  environment& env) const;
89 
90  virtual session_flags
91  get_session_flags (chroot const& chroot) const;
92 
93  protected:
94  virtual void
96  bool lock,
97  int status);
98 
99  virtual void
100  get_details (chroot const& chroot,
101  format_detail& detail) const;
102 
103  virtual void
104  get_keyfile (chroot const& chroot,
105  keyfile& keyfile) const;
106 
107  virtual void
109  keyfile const& keyfile,
110  string_list& used_keys);
111 
112  private:
114  std::string file;
115  };
116 
117 }
118 
119 #endif /* SBUILD_CHROOT_LOOPBACK_H */
120 
121 /*
122  * Local Variables:
123  * mode:C++
124  * End:
125  */