paludis Version 3.0.2
The one true package mangler
ndbam_unmerger.hh
1/* vim: set sw=4 sts=4 et foldmethod=syntax : */
2
3/*
4 * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
5 * Copyright (c) 2007 Piotr JaroszyƄski
6 *
7 * This file is part of the Paludis package manager. Paludis is free software;
8 * you can redistribute it and/or modify it under the terms of the GNU General
9 * Public License version 2, as published by the Free Software Foundation.
10 *
11 * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14 * details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 * Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_UNMERGER_HH
22#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_UNMERGER_HH 1
23
24#include <paludis/util/pimp.hh>
25#include <paludis/output_manager-fwd.hh>
26#include <paludis/unmerger.hh>
29#include <functional>
30
31namespace paludis
32{
33 namespace n
34 {
35 typedef Name<struct name_config_protect> config_protect;
36 typedef Name<struct name_config_protect_mask> config_protect_mask;
37 typedef Name<struct name_contents_file> contents_file;
38 typedef Name<struct name_environment> environment;
39 typedef Name<struct name_ignore> ignore;
40 typedef Name<struct name_ndbam> ndbam;
41 typedef Name<struct name_output_manager> output_manager;
42 typedef Name<struct name_package_id> package_id;
43 typedef Name<struct name_root> root;
44 }
45
46 class NDBAM;
47
60
61 class PALUDIS_VISIBLE NDBAMUnmergerError :
62 public UnmergerError
63 {
64 public:
65 NDBAMUnmergerError(const std::string &) noexcept;
66 };
67
68 /**
69 * Unmerger implementation for NDBAM.
70 *
71 * \ingroup g_ndbam
72 * \since 0.26
73 */
74 class PALUDIS_VISIBLE NDBAMUnmerger :
75 public Unmerger
76 {
77 private:
79
80 void _add_file(const std::shared_ptr<const ContentsEntry> &);
81 void _add_dir(const std::shared_ptr<const ContentsEntry> &);
82 void _add_sym(const std::shared_ptr<const ContentsEntry> &);
83
84 protected:
85 bool config_protected(const FSPath &) const;
86 std::string make_tidy(const FSPath &) const;
87
88 void populate_unmerge_set() override;
89
90 void display(const std::string &) const override;
91
92 bool check_file(const std::shared_ptr<const ContentsEntry> &) const override;
93 bool check_dir(const std::shared_ptr<const ContentsEntry> &) const override;
94 bool check_sym(const std::shared_ptr<const ContentsEntry> &) const override;
95 bool check_misc(const std::shared_ptr<const ContentsEntry> &) const override;
96
97 public:
98 ///\name Basic operations
99 ///\{
100
101 NDBAMUnmerger(const NDBAMUnmergerOptions &);
102 ~NDBAMUnmerger() override;
103
104 ///\}
105
106 Hook extend_hook(const Hook &) const override;
107 };
108}
109
110#endif
Definition fs_path.hh:34
Definition hook.hh:75
void populate_unmerge_set() override
Hook extend_hook(const Hook &) const override
Definition ndbam.hh:70
Definition named_value.hh:51
Definition pimp.hh:52
#define PALUDIS_VISIBLE
Definition attributes.hh:59
Definition about_metadata-fwd.hh:24
Definition ndbam_unmerger.hh:49