paludis  Version 2.6.0
stripper.hh
1 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
2 
3 /*
4  * Copyright (c) 2008, 2010, 2011 Ciaran McCreesh
5  *
6  * This file is part of the Paludis package manager. Paludis is free software;
7  * you can redistribute it and/or modify it under the terms of the GNU General
8  * Public License version 2, as published by the Free Software Foundation.
9  *
10  * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17  * Place, Suite 330, Boston, MA 02111-1307 USA
18  */
19 
20 #ifndef PALUDIS_GUARD_PALUDIS_STRIPPER_HH
21 #define PALUDIS_GUARD_PALUDIS_STRIPPER_HH 1
22 
23 #include <paludis/stripper-fwd.hh>
24 #include <paludis/action-fwd.hh>
26 #include <paludis/util/pimp.hh>
27 #include <paludis/util/fs_path.hh>
28 #include <paludis/util/named_value.hh>
30 
31 namespace paludis
32 {
33  namespace n
34  {
35  typedef Name<struct name_compress_splits> compress_splits;
36  typedef Name<struct name_debug_dir> debug_dir;
37  typedef Name<struct name_dwarf_compression> dwarf_compression;
38  typedef Name<struct name_image_dir> image_dir;
39  typedef Name<struct name_split> split;
40  typedef Name<struct name_strip> strip;
41  }
42 
44  {
51  };
52 
54  public Exception
55  {
56  public:
57  StripperError(const std::string &) noexcept;
58  };
59 
61  {
62  private:
63  Pimp<Stripper> _imp;
64 
65  protected:
66  virtual void on_enter_dir(const FSPath &) = 0;
67  virtual void on_leave_dir(const FSPath &) = 0;
68 
69  virtual void on_strip(const FSPath &) = 0;
70  virtual void on_split(const FSPath &, const FSPath &) = 0;
71  virtual void on_dwarf_compress(const FSPath &) = 0;
72  virtual void on_unknown(const FSPath &) = 0;
73 
74  virtual void do_dir_recursive(const FSPath &);
75 
76  virtual std::string file_type(const FSPath &);
77 
78  virtual void do_split(const FSPath &, const FSPath &);
79  virtual void do_strip(const FSPath &, const std::string &);
80  virtual void do_dwarf_compress(const FSPath &);
81 
82  virtual std::string strip_action_desc() const;
83  virtual std::string split_action_desc() const;
84  virtual std::string unknown_action_desc() const;
85  virtual std::string dwarf_compress_desc() const;
86 
87  public:
88  ///\name Basic operations
89  ///\{
90 
91  Stripper(const StripperOptions &);
92  virtual ~Stripper() = 0;
93 
94  ///\}
95 
96  /**
97  * Perform the strip.
98  */
99  virtual void strip();
100  };
101 }
102 
103 #endif
Definition: pimp.hh:51
Definition: about_metadata-fwd.hh:23
Definition: stripper.hh:43
Definition: stripper.hh:60
Definition: exception.hh:74
Definition: stripper.hh:53
Definition: fs_path.hh:33
#define PALUDIS_VISIBLE
Definition: attributes.hh:59