sbuild  1.7.2
source-clonable.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_SOURCE_CLONABLE_H
20 #define SBUILD_CHROOT_FACET_SOURCE_CLONABLE_H
21 
22 #include <sbuild/chroot/facet/facet.h>
23 
24 namespace sbuild
25 {
26  namespace chroot
27  {
28  namespace facet
29  {
30 
39  class source_clonable : public facet
40  {
41  public:
43  typedef std::shared_ptr<source_clonable> ptr;
44 
46  typedef std::shared_ptr<const source_clonable> const_ptr;
47 
48  private:
50  source_clonable ();
51 
52  public:
54  virtual ~source_clonable ();
55 
61  static ptr
62  create ();
63 
64  virtual facet::ptr
65  clone () const;
66 
67  virtual std::string const&
68  get_name () const;
69 
75  virtual chroot::ptr
76  clone_source () const;
77 
84  virtual bool
85  get_source_clone () const;
86 
93  virtual void
94  set_source_clone (bool clone);
95 
101  virtual string_list const&
102  get_source_users () const;
103 
109  virtual void
110  set_source_users (const string_list& users);
111 
117  virtual string_list const&
118  get_source_groups () const;
119 
125  virtual void
126  set_source_groups (const string_list& groups);
127 
135  virtual string_list const&
136  get_source_root_users () const;
137 
145  virtual void
146  set_source_root_users (const string_list& users);
147 
155  virtual string_list const&
156  get_source_root_groups () const;
157 
165  virtual void
166  set_source_root_groups (const string_list& groups);
167 
168  virtual session_flags
169  get_session_flags () const;
170 
171  virtual void
172  get_details (format_detail& detail) const;
173 
174  virtual void
175  get_used_keys (string_list& used_keys) const;
176 
177  virtual void
178  get_keyfile (keyfile& keyfile) const;
179 
180  virtual void
181  set_keyfile (const keyfile& keyfile);
182 
183  private:
194  };
195 
196  }
197  }
198 }
199 
200 #endif /* SBUILD_CHROOT_FACET_SOURCE_CLONABLE_H */
201 
202 /*
203  * Local Variables:
204  * mode:C++
205  * End:
206  */
virtual void set_keyfile(const keyfile &keyfile)
Set the chroot properties from a keyfile.
Definition: source-clonable.cc:204
virtual bool get_source_clone() const
Is cloning a source chroot automatically permitted? Note that this is merely a hint and does not prev...
Definition: source-clonable.cc:90
Debian source builder components.
Definition: ctty.cc:31
string_list source_groups
Groups allowed to access the source chroot.
Definition: source-clonable.h:189
virtual void set_source_clone(bool clone)
Set if cloning a source chroot automatically is permitted.
Definition: source-clonable.cc:96
Chroot support for creation of source chroots.
Definition: source-clonable.h:39
static ptr create()
Create a chroot facet.
Definition: source-clonable.cc:72
string_list source_users
Users allowed to access the source chroot.
Definition: source-clonable.h:187
virtual facet::ptr clone() const
Copy the chroot facet.
Definition: source-clonable.cc:78
virtual string_list const & get_source_groups() const
Get the groups allowed to access the source chroot.
Definition: source-clonable.cc:114
virtual session_flags get_session_flags() const
Get the session flags of the chroot.
Definition: source-clonable.cc:150
virtual chroot::ptr clone_source() const
Clone a source chroot.
Definition: source-clonable.cc:233
virtual ~source_clonable()
The destructor.
Definition: source-clonable.cc:67
virtual void set_source_root_users(const string_list &users)
Set the users allowed to access the source chroot as root.
Definition: source-clonable.cc:132
virtual void get_details(format_detail &detail) const
Get detailed information about the chroot for output.
Definition: source-clonable.cc:170
virtual void get_keyfile(keyfile &keyfile) const
Copy the chroot properties into a keyfile.
Definition: source-clonable.cc:180
session_flags
Chroot session properties.
Definition: facet.h:54
Base class for all facets.
Definition: facet.h:50
std::vector< std::string > string_list
A string vector.
Definition: types.h:38
bool source_clone
Is source chroot cloning permitted?
Definition: source-clonable.h:185
std::shared_ptr< chroot > ptr
A shared_ptr to a chroot object.
Definition: chroot.h:103
virtual std::string const & get_name() const
Get the name of the chroot facet.
Definition: source-clonable.cc:84
virtual string_list const & get_source_root_users() const
Get the users allowed to access the source chroot as root.
Definition: source-clonable.cc:126
Format names and values for output.
Definition: format-detail.h:38
source_clonable()
The constructor.
Definition: source-clonable.cc:57
virtual void set_source_groups(const string_list &groups)
Set the groups allowed to access the source chroot.
Definition: source-clonable.cc:120
string_list source_root_groups
Groups allowed to access the source chroot as root.
Definition: source-clonable.h:193
virtual string_list const & get_source_users() const
Get the users allowed to access the source chroot.
Definition: source-clonable.cc:102
Configuration file parser.
Definition: keyfile.h:46
virtual void set_source_users(const string_list &users)
Set the users allowed to access the source chroot.
Definition: source-clonable.cc:108
std::shared_ptr< const source_clonable > const_ptr
A shared_ptr to a const chroot facet object.
Definition: source-clonable.h:46
std::shared_ptr< source_clonable > ptr
A shared_ptr to a chroot facet object.
Definition: source-clonable.h:43
string_list source_root_users
Users allowed to access the source chroot as root.
Definition: source-clonable.h:191
std::shared_ptr< facet > ptr
A shared_ptr to a chroot facet object.
Definition: facet.h:63
virtual string_list const & get_source_root_groups() const
Get the groups allowed to access the source chroot as root.
Definition: source-clonable.cc:138
virtual void get_used_keys(string_list &used_keys) const
Get a list of the keys used during keyfile parsing.
Definition: source-clonable.cc:160
virtual void set_source_root_groups(const string_list &groups)
Set the groups allowed to access the source chroot as root.
Definition: source-clonable.cc:144