sbuild  1.6.10
sbuild-chroot-facet-session.h
1 /* Copyright © 2005-2009 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_SESSION_H
20 #define SBUILD_CHROOT_FACET_SESSION_H
21 
22 #include <sbuild/sbuild-chroot-facet.h>
23 #include <sbuild/sbuild-session.h>
24 
25 namespace sbuild
26 {
27 
36  {
37  public:
39  typedef std::shared_ptr<chroot_facet_session> ptr;
40 
42  typedef std::shared_ptr<const chroot_facet_session> const_ptr;
43 
44  private:
51 
52  public:
54  virtual ~chroot_facet_session ();
55 
61  static ptr
62  create ();
63 
71  static ptr
73 
74  virtual chroot_facet::ptr
75  clone () const;
76 
77  virtual std::string const&
78  get_name () const;
79 
85  std::string const&
86  get_original_name () const;
87 
94  void
95  set_original_name (std::string const& name);
96 
102  std::string const&
103  get_selected_name () const;
104 
110  void
111  set_selected_name (std::string const& name);
112 
119  const chroot::ptr&
120  get_parent_chroot() const;
121 
122  virtual void
123  setup_env (chroot const& chroot,
124  environment& env) const;
125 
126  virtual chroot::session_flags
127  get_session_flags (chroot const& chroot) const;
128 
129  virtual void
130  get_details (chroot const& chroot,
131  format_detail& detail) const;
132 
133  virtual void
134  get_keyfile (chroot const& chroot,
135  keyfile& keyfile) const;
136 
137  virtual void
139  keyfile const& keyfile,
140  string_list& used_keys);
141 
142  private:
144  std::string original_chroot_name;
146  std::string selected_chroot_name;
149  };
150 
151 }
152 
153 #endif /* SBUILD_CHROOT_FACET_SESSION_H */
154 
155 /*
156  * Local Variables:
157  * mode:C++
158  * End:
159  */
virtual void get_details(chroot const &chroot, format_detail &detail) const
Get detailed information about the chroot for output.
Definition: sbuild-chroot-facet-session.cc:138
void set_original_name(std::string const &name)
Set the original name of the chroot (prior to session cloning).
Definition: sbuild-chroot-facet-session.cc:87
virtual ~chroot_facet_session()
The destructor.
Definition: sbuild-chroot-facet-session.cc:50
Debian source builder components.
Definition: sbuild-auth-null.h:24
virtual void setup_env(chroot const &chroot, environment &env) const
Set environment.
Definition: sbuild-chroot-facet-session.cc:114
Chroot support for sessions.
Definition: sbuild-chroot-facet-session.h:35
std::shared_ptr< chroot_facet_session > ptr
A shared_ptr to a chroot facet object.
Definition: sbuild-chroot-facet-session.h:39
Container of environment variables.
Definition: sbuild-environment.h:38
const chroot::ptr & get_parent_chroot() const
Get parent chroot.
Definition: sbuild-chroot-facet-session.cc:108
std::string const & get_selected_name() const
Get the selected name of the chroot (alias used).
Definition: sbuild-chroot-facet-session.cc:94
void set_selected_name(std::string const &name)
Set the selected name of the chroot (alias used).
Definition: sbuild-chroot-facet-session.cc:100
std::string selected_chroot_name
Selected chroot name.
Definition: sbuild-chroot-facet-session.h:146
Configuration file parser.
Definition: sbuild-basic-keyfile.h:138
virtual chroot_facet::ptr clone() const
Copy the chroot facet.
Definition: sbuild-chroot-facet-session.cc:67
virtual void get_keyfile(chroot const &chroot, keyfile &keyfile) const
Copy the chroot properties into a keyfile.
Definition: sbuild-chroot-facet-session.cc:150
static ptr create()
Create a chroot facet.
Definition: sbuild-chroot-facet-session.cc:55
virtual std::string const & get_name() const
Get the name of the chroot facet.
Definition: sbuild-chroot-facet-session.cc:73
std::vector< std::string > string_list
A string vector.
Definition: sbuild-types.h:38
session_flags
Chroot session properties.
Definition: sbuild-chroot.h:57
std::shared_ptr< chroot_facet > ptr
A shared_ptr to a chroot facet object.
Definition: sbuild-chroot-facet.h:44
chroot_facet_session(const chroot::ptr &parent_chroot)
The constructor.
Definition: sbuild-chroot-facet-session.cc:42
Format names and values for output.
Definition: sbuild-format-detail.h:38
virtual chroot::session_flags get_session_flags(chroot const &chroot) const
Get the session flags of the chroot.
Definition: sbuild-chroot-facet-session.cc:127
std::string const & get_original_name() const
Get the original name of the chroot (prior to session cloning).
Definition: sbuild-chroot-facet-session.cc:81
Common chroot data.
Definition: sbuild-chroot.h:45
std::shared_ptr< const chroot_facet_session > const_ptr
A shared_ptr to a const chroot facet object.
Definition: sbuild-chroot-facet-session.h:42
const chroot::ptr parent_chroot
Parent chroot.
Definition: sbuild-chroot-facet-session.h:148
std::string original_chroot_name
Original chroot name prior to session cloning.
Definition: sbuild-chroot-facet-session.h:144
Common chroot data.
Definition: sbuild-chroot-facet.h:40
std::shared_ptr< chroot > ptr
A shared_ptr to a chroot object.
Definition: sbuild-chroot.h:105
virtual void set_keyfile(chroot &chroot, keyfile const &keyfile, string_list &used_keys)
Set the chroot properties from a keyfile.
Definition: sbuild-chroot-facet-session.cc:163