sbuild  1.7.1
file.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_FILE_H
20 #define SBUILD_CHROOT_FACET_FILE_H
21 
22 #include <sbuild/chroot/chroot.h>
23 #include <sbuild/chroot/facet/facet.h>
24 #include <sbuild/chroot/facet/source-setup.h>
25 #include <sbuild/chroot/facet/storage.h>
26 
27 namespace sbuild
28 {
29  namespace chroot
30  {
31  namespace facet
32  {
33 
39  class file : public facet,
40  public storage,
41  public source_setup
42  {
43  public:
46 
48  typedef std::shared_ptr<file> ptr;
49 
51  typedef std::shared_ptr<const file> const_ptr;
52 
53  protected:
55  file ();
56 
58  file (const file& rhs);
59 
60  void
62  bool copy);
63 
64  friend class chroot;
65 
66  public:
68  virtual ~file ();
69 
70  virtual std::string const&
71  get_name () const;
72 
78  static ptr
79  create ();
80 
82  clone () const;
83 
89  std::string const&
90  get_filename () const;
91 
97  void
98  set_filename (const std::string& filename);
99 
106  virtual std::string const&
107  get_location () const;
108 
115  virtual void
116  set_location (const std::string& location);
117 
124  bool
125  get_file_repack () const;
126 
134  void
135  set_file_repack (bool repack);
136 
137  virtual void
138  setup_env (environment& env) const;
139 
140  std::string
141  get_path () const;
142 
143  virtual session_flags
144  get_session_flags () const;
145 
146  protected:
147  virtual void
148  setup_lock (chroot::setup_type type,
149  bool lock,
150  int status);
151 
152  virtual void
153  get_details (format_detail& detail) const;
154 
155  virtual void
156  get_used_keys (string_list& used_keys) const;
157 
158  virtual void
159  get_keyfile (keyfile& keyfile) const;
160 
161  virtual void
162  set_keyfile (const keyfile& keyfile);
163 
164  virtual void
165  chroot_source_setup (const chroot& parent);
166 
167  private:
169  std::string filename;
171  std::string location;
173  bool repack;
174  };
175 
176  }
177  }
178 }
179 
180 #endif /* SBUILD_CHROOT_FACET_FILE_H */
181 
182 /*
183  * Local Variables:
184  * mode:C++
185  * End:
186  */