paludis  Version 2.6.0
fake_installed_repository.hh
1 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
2 
3 /*
4  * Copyright (c) 2005, 2006, 2007, 2008, 2009, 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_REPOSITORIES_FAKE_FAKE_INSTALLED_REPOSITORY_HH
21 #define PALUDIS_GUARD_PALUDIS_REPOSITORIES_FAKE_FAKE_INSTALLED_REPOSITORY_HH 1
22 
24 
25 namespace paludis
26 {
27  namespace n
28  {
29  typedef Name<struct name_environment> environment;
30  typedef Name<struct name_name> name;
31  typedef Name<struct name_suitable_destination> suitable_destination;
32  typedef Name<struct name_supports_uninstall> supports_uninstall;
33  }
34 
35  /**
36  * Parameters for a FakeInstalledRepository.
37  */
39  {
42  NamedValue<n::suitable_destination, bool> suitable_destination;
43  NamedValue<n::supports_uninstall, bool> supports_uninstall;
44  };
45 
46  /**
47  * A fake repository for test cases, for installed packages.
48  *
49  * \ingroup grpfakerepository
50  */
52  public FakeRepositoryBase,
54  {
55  private:
57 
58  protected:
59  /* RepositoryDestinationInterface */
60 
61  virtual bool is_suitable_destination_for(const std::shared_ptr<const PackageID> &) const
62  PALUDIS_ATTRIBUTE((warn_unused_result));
63 
64  virtual bool want_pre_post_phases() const
65  PALUDIS_ATTRIBUTE((warn_unused_result));
66 
67  virtual void merge(const MergeParams &);
68 
69  public:
70  ///\name Basic operations
71  ///\{
72 
73  ///\since 0.42
76 
77  ///\}
78 
79  virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
80 
81  virtual bool some_ids_might_not_be_masked() const;
82 
83  virtual const bool is_unimportant() const;
84 
85  /* Keys */
86  virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
87  virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
88  virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
89  virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
90 
91  virtual const std::shared_ptr<const Set<std::string> > maybe_expand_licence_nonrecursively(
92  const std::string &) const;
93 
94  ///\name RepositoryFactory functions
95  ///\{
96 
97  static RepositoryName repository_factory_name(
98  const Environment * const env,
99  const std::function<std::string (const std::string &)> &);
100 
101  static std::shared_ptr<Repository> repository_factory_create(
102  Environment * const env,
103  const std::function<std::string (const std::string &)> &);
104 
105  static std::shared_ptr<const RepositoryNameSet> repository_factory_dependencies(
106  const Environment * const env,
107  const std::function<std::string (const std::string &)> &);
108 
109  ///\}
110  };
111 }
112 
113 #endif
Definition: pimp.hh:51
Definition: about_metadata-fwd.hh:23
Definition: fake_installed_repository.hh:38
Definition: environment.hh:200
Definition: named_value-fwd.hh:26
Definition: wrapped_value-fwd.hh:29
Definition: repository.hh:107
Definition: action.hh:618
Definition: fake_repository_base.hh:45
Definition: fake_installed_repository.hh:51
#define PALUDIS_ATTRIBUTE(x)
Definition: attributes.hh:53
#define PALUDIS_VISIBLE
Definition: attributes.hh:59
Definition: repository.hh:517