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::shared_ptr<chroot_facet_union> ptr;
00053 
00055     typedef std::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     bool
00085     get_union_configured () const;
00086 
00093     virtual std::string const&
00094     get_union_type () const;
00095 
00103     virtual void
00104     set_union_type (std::string const& union_type);
00105 
00112     virtual std::string const&
00113     get_union_mount_options () const;
00114 
00127     virtual void
00128     set_union_mount_options (std::string const& union_mount_options);
00129 
00135     virtual std::string const&
00136     get_union_overlay_directory () const;
00137 
00143     virtual void
00144     set_union_overlay_directory (std::string const& directory);
00145 
00151     virtual std::string const&
00152     get_union_underlay_directory () const;
00153 
00159     virtual void
00160     set_union_underlay_directory (std::string const& directory);
00161 
00162     virtual void
00163     setup_env (chroot const& chroot,
00164                environment&  env) const;
00165 
00166     virtual chroot::session_flags
00167     get_session_flags (chroot const& chroot) const;
00168 
00169     virtual void
00170     get_details (chroot const&  chroot,
00171                  format_detail& detail) const;
00172 
00173     virtual void
00174     get_keyfile (chroot const& chroot,
00175                  keyfile&      keyfile) const;
00176 
00177     virtual void
00178     set_keyfile (chroot&        chroot,
00179                  keyfile const& keyfile,
00180                  string_list&   used_keys);
00181 
00182   private:
00184     std::string union_type;
00186     std::string union_mount_options;
00188     std::string union_overlay_directory;
00190     std::string union_underlay_directory;
00191   };
00192 
00193 }
00194 
00195 #endif /* SBUILD_CHROOT_FACET_UNION_H */
00196 
00197 /*
00198  * Local Variables:
00199  * mode:C++
00200  * End:
00201  */