sbuild  1.7.2
directory-base.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_DIRECTORY_BASE_H
20 #define SBUILD_CHROOT_FACET_DIRECTORY_BASE_H
21 
22 #include <sbuild/chroot/chroot.h>
23 #include <sbuild/chroot/facet/facet.h>
24 #include <sbuild/chroot/facet/storage.h>
25 
26 namespace sbuild
27 {
28  namespace chroot
29  {
30  namespace facet
31  {
32 
45  class directory_base : public facet,
46  public storage
47  {
48  public:
51 
52  protected:
54  directory_base ();
55 
57  directory_base (const directory_base& rhs);
58 
59  friend class chroot;
60 
61  public:
63  virtual ~directory_base ();
64 
65  public:
71  std::string const&
72  get_directory () const;
73 
79  void
80  set_directory (const std::string& directory);
81 
82  virtual void
83  setup_env (environment& env) const;
84 
85  protected:
86  virtual void
87  get_details (format_detail& detail) const;
88 
89  virtual void
90  get_used_keys (string_list& used_keys) const;
91 
92  virtual void
93  get_keyfile (keyfile& keyfile) const;
94 
95  virtual void
96  set_keyfile (const keyfile& keyfile);
97 
99  std::string directory;
100  };
101 
102  }
103  }
104 }
105 
106 #endif /* SBUILD_CHROOT_FACET_DIRECTORY_BASE_H */
107 
108 /*
109  * Local Variables:
110  * mode:C++
111  * End:
112  */
void set_directory(const std::string &directory)
Set the directory containing the chroot.
Definition: directory-base.cc:62
Debian source builder components.
Definition: ctty.cc:31
directory_base()
The constructor.
Definition: directory-base.cc:37
Chroot storage.
Definition: storage.h:39
virtual void get_keyfile(keyfile &keyfile) const
Copy the chroot properties into a keyfile.
Definition: directory-base.cc:90
virtual void get_used_keys(string_list &used_keys) const
Get a list of the keys used during keyfile parsing.
Definition: directory-base.cc:83
A base class for chroots located in a local directory.
Definition: directory-base.h:45
Container of environment variables.
Definition: environment.h:38
Common chroot data.
Definition: chroot.h:50
A chroot located in the filesystem.
Definition: directory.h:41
std::string directory
The directory to use.
Definition: directory-base.h:99
virtual void setup_env(environment &env) const
Set environment.
Definition: directory-base.cc:71
virtual void get_details(format_detail &detail) const
Get detailed information about the chroot for output.
Definition: directory-base.cc:77
Base class for all facets.
Definition: facet.h:50
virtual ~directory_base()
The destructor.
Definition: directory-base.cc:51
std::vector< std::string > string_list
A string vector.
Definition: types.h:38
Custom error.
Definition: custom-error.h:31
Format names and values for output.
Definition: format-detail.h:38
chroot::error error
Exception type.
Definition: directory-base.h:50
Configuration file parser.
Definition: keyfile.h:46
std::string const & get_directory() const
Get the directory containing the chroot.
Definition: directory-base.cc:56
virtual void set_keyfile(const keyfile &keyfile)
Set the chroot properties from a keyfile.
Definition: directory-base.cc:97