sbuild  1.4.26
sbuild-chroot-facet-union.h
00001 /* Copyright © 2008-2009  Jan-Marek Glogowski <glogow@fbihome.de>
00002  * Copyright © 2005-2009  Roger Leigh <rleigh@debian.org>
00003  *
00004  * schroot is free software: you can redistribute it and/or modify it
00005  * under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation, either version 3 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * schroot is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see
00016  * <http://www.gnu.org/licenses/>.
00017  *
00018  *********************************************************************/
00019 
00020 #ifndef SBUILD_CHROOT_FACET_UNION_H
00021 #define SBUILD_CHROOT_FACET_UNION_H
00022 
00023 #include <sbuild/sbuild-chroot-facet.h>
00024 
00025 namespace sbuild
00026 {
00027 
00037   class chroot_facet_union : public chroot_facet
00038   {
00039   public:
00041     enum error_code
00042       {
00043         UNION_TYPE_UNKNOWN, 
00044         UNION_OVERLAY_ABS,  
00045         UNION_UNDERLAY_ABS  
00046       };
00047 
00049     typedef custom_error<error_code> error;
00050 
00052     typedef std::tr1::shared_ptr<chroot_facet_union> ptr;
00053 
00055     typedef std::tr1::shared_ptr<const chroot_facet_union> const_ptr;
00056 
00057   private:
00059     chroot_facet_union ();
00060 
00061   public:
00063     virtual ~chroot_facet_union ();
00064 
00070     static ptr
00071     create ();
00072 
00073     virtual chroot_facet::ptr
00074     clone () const;
00075 
00076     std::string const&
00077     get_name () const;
00078 
00084     void
00085     clone_source_setup (chroot::ptr& clone) const;
00086 
00092     bool
00093     get_union_configured () const;
00094 
00101     virtual std::string const&
00102     get_union_type () const;
00103 
00111     virtual void
00112     set_union_type (std::string const& union_type);
00113 
00120     virtual std::string const&
00121     get_union_mount_options () const;
00122 
00135     virtual void
00136     set_union_mount_options (std::string const& union_mount_options);
00137 
00143     virtual std::string const&
00144     get_union_overlay_directory () const;
00145 
00151     virtual void
00152     set_union_overlay_directory (std::string const& directory);
00153 
00159     virtual std::string const&
00160     get_union_underlay_directory () const;
00161 
00167     virtual void
00168     set_union_underlay_directory (std::string const& directory);
00169 
00170     virtual void
00171     setup_env (chroot const& chroot,
00172                environment&  env) const;
00173 
00174     virtual chroot::session_flags
00175     get_session_flags (chroot const& chroot) const;
00176 
00177     virtual void
00178     get_details (chroot const&  chroot,
00179                  format_detail& detail) const;
00180 
00181     virtual void
00182     get_keyfile (chroot const& chroot,
00183                  keyfile&      keyfile) const;
00184 
00185     virtual void
00186     set_keyfile (chroot&        chroot,
00187                  keyfile const& keyfile,
00188                  string_list&   used_keys);
00189 
00190   private:
00192     std::string union_type;
00194     std::string union_mount_options;
00196     std::string union_overlay_directory;
00198     std::string union_underlay_directory;
00199   };
00200 
00201 }
00202 
00203 #endif /* SBUILD_CHROOT_FACET_UNION_H */
00204 
00205 /*
00206  * Local Variables:
00207  * mode:C++
00208  * End:
00209  */