paludis Version 3.0.2
The one true package mangler
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
31namespace 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 typedef Name<struct name_tool_prefix> tool_prefix;
42 }
43
54
55 class PALUDIS_VISIBLE StripperError :
56 public Exception
57 {
58 public:
59 StripperError(const std::string &) noexcept;
60 };
61
62 class PALUDIS_VISIBLE Stripper
63 {
64 private:
65 Pimp<Stripper> _imp;
66
67 protected:
68 virtual void on_enter_dir(const FSPath &) = 0;
69 virtual void on_leave_dir(const FSPath &) = 0;
70
71 virtual void on_strip(const FSPath &) = 0;
72 virtual void on_split(const FSPath &, const FSPath &) = 0;
73 virtual void on_dwarf_compress(const FSPath &) = 0;
74 virtual void on_unknown(const FSPath &) = 0;
75
76 virtual void do_dir_recursive(const FSPath &);
77
78 virtual std::string file_type(const FSPath &);
79
80 virtual void do_split(const FSPath &, const FSPath &);
81 virtual void do_strip(const FSPath &, const std::string &);
82 virtual void do_dwarf_compress(const FSPath &);
83
84 virtual std::string strip_action_desc() const;
85 virtual std::string split_action_desc() const;
86 virtual std::string unknown_action_desc() const;
87 virtual std::string dwarf_compress_desc() const;
88
89 public:
90 ///\name Basic operations
91 ///\{
92
93 Stripper(const StripperOptions &);
94 virtual ~Stripper() = 0;
95
96 ///\}
97
98 /**
99 * Perform the strip.
100 */
101 virtual void strip();
102 };
103}
104
105#endif
Definition fs_path.hh:34
Definition named_value.hh:51
Definition pimp.hh:52
virtual void strip()
#define PALUDIS_VISIBLE
Definition attributes.hh:59
Definition about_metadata-fwd.hh:24
Definition stripper.hh:45