sbuild  1.6.0
sbuild-chroot-btrfs-snapshot.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_BTRFS_SNAPSHOT_H
20 #define SBUILD_CHROOT_BTRFS_SNAPSHOT_H
21 
22 #include <sbuild/sbuild-chroot.h>
23 
24 namespace sbuild
25 {
26 
33  {
34  protected:
37 
40 
41  friend class chroot;
42 
43  public:
45  virtual ~chroot_btrfs_snapshot ();
46 
47  virtual chroot::ptr
48  clone () const;
49 
50  virtual chroot::ptr
51  clone_session (std::string const& session_id,
52  std::string const& alias,
53  std::string const& user,
54  bool root) const;
55 
56  virtual chroot::ptr
57  clone_source () const;
58 
65  std::string const&
66  get_source_subvolume () const;
67 
74  void
75  set_source_subvolume (std::string const& source_subvolume);
76 
82  std::string const&
83  get_snapshot_directory () const;
84 
90  void
91  set_snapshot_directory (std::string const& snapshot_directory);
92 
99  std::string const&
100  get_snapshot_name () const;
101 
108  void
109  set_snapshot_name (std::string const& snapshot_name);
110 
111  virtual std::string const&
112  get_chroot_type () const;
113 
114  virtual std::string
115  get_path () const;
116 
117  virtual void
118  setup_env (chroot const& chroot,
119  environment& env) const;
120 
121  virtual session_flags
122  get_session_flags (chroot const& chroot) const;
123 
124  protected:
125  virtual void
127  bool lock,
128  int status);
129 
130  virtual void
131  get_details (chroot const& chroot,
132  format_detail& detail) const;
133 
134  virtual void
135  get_keyfile (chroot const& chroot,
136  keyfile& keyfile) const;
137 
138  virtual void
139  set_keyfile (chroot& chroot,
140  keyfile const& keyfile,
141  string_list& used_keys);
142 
143  private:
145  std::string source_subvolume;
147  std::string snapshot_directory;
149  std::string snapshot_name;
150  };
151 
152 }
153 
154 #endif /* SBUILD_CHROOT_BTRFS_SNAPSHOT_H */
155 
156 /*
157  * Local Variables:
158  * mode:C++
159  * End:
160  */