paludis  Version 2.6.0
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 
31 namespace 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 
49  {
59  };
60 
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  */
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();
89 
90  void display(const std::string &) const;
91 
92  bool check_file(const std::shared_ptr<const ContentsEntry> &) const;
93  bool check_dir(const std::shared_ptr<const ContentsEntry> &) const;
94  bool check_sym(const std::shared_ptr<const ContentsEntry> &) const;
95  bool check_misc(const std::shared_ptr<const ContentsEntry> &) const;
96 
97  public:
98  ///\name Basic operations
99  ///\{
100 
102  ~NDBAMUnmerger();
103 
104  ///\}
105 
106  virtual Hook extend_hook(const Hook &) const;
107  };
108 }
109 
110 #endif
Definition: pimp.hh:51
Definition: about_metadata-fwd.hh:23
Definition: ndbam_unmerger.hh:74
Definition: ndbam_unmerger.hh:48
Definition: ndbam_unmerger.hh:61
Definition: unmerger.hh:97
Definition: hook.hh:74
Definition: unmerger.hh:79
Definition: fs_path.hh:33
#define PALUDIS_VISIBLE
Definition: attributes.hh:59