stripper.hh

00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
00002 
00003 /*
00004  * Copyright (c) 2008 Ciaran McCreesh
00005  *
00006  * This file is part of the Paludis package manager. Paludis is free software;
00007  * you can redistribute it and/or modify it under the terms of the GNU General
00008  * Public License version 2, as published by the Free Software Foundation.
00009  *
00010  * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
00011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00012  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00013  * details.
00014  *
00015  * You should have received a copy of the GNU General Public License along with
00016  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00017  * Place, Suite 330, Boston, MA  02111-1307  USA
00018  */
00019 
00020 #ifndef PALUDIS_GUARD_PALUDIS_STRIPPER_HH
00021 #define PALUDIS_GUARD_PALUDIS_STRIPPER_HH 1
00022 
00023 #include <paludis/stripper-fwd.hh>
00024 #include <paludis/action-fwd.hh>
00025 #include <paludis/util/attributes.hh>
00026 #include <paludis/util/private_implementation_pattern.hh>
00027 #include <paludis/util/fs_entry.hh>
00028 #include <paludis/util/named_value.hh>
00029 
00030 namespace paludis
00031 {
00032     namespace n
00033     {
00034         struct debug_dir;
00035         struct image_dir;
00036         struct split;
00037         struct strip;
00038     }
00039 
00040     struct StripperOptions
00041     {
00042         NamedValue<n::debug_dir, FSEntry> debug_dir;
00043         NamedValue<n::image_dir, FSEntry> image_dir;
00044         NamedValue<n::split, bool> split;
00045         NamedValue<n::strip, bool> strip;
00046     };
00047 
00048     class PALUDIS_VISIBLE Stripper :
00049         private PrivateImplementationPattern<Stripper>
00050     {
00051         protected:
00052             virtual void on_enter_dir(const FSEntry &) = 0;
00053             virtual void on_leave_dir(const FSEntry &) = 0;
00054 
00055             virtual void on_strip(const FSEntry &) = 0;
00056             virtual void on_split(const FSEntry &, const FSEntry &) = 0;
00057             virtual void on_unknown(const FSEntry &) = 0;
00058 
00059             virtual void do_dir_recursive(const FSEntry &);
00060 
00061             virtual std::string file_type(const FSEntry &);
00062 
00063             virtual void do_split(const FSEntry &, const FSEntry &);
00064             virtual void do_strip(const FSEntry &, const std::string &);
00065 
00066         public:
00067             ///\name Basic operations
00068             ///\{
00069 
00070             Stripper(const StripperOptions &);
00071             virtual ~Stripper() = 0;
00072 
00073             ///\}
00074 
00075             /**
00076              * Perform the strip.
00077              */
00078             virtual void strip();
00079     };
00080 }
00081 
00082 #endif

Generated on Mon Sep 21 10:36:08 2009 for paludis by  doxygen 1.5.4