paludis Version 3.0.2
The one true package mangler
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
25namespace 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 */
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 bool is_suitable_destination_for(const std::shared_ptr<const PackageID> &) const
62 override PALUDIS_ATTRIBUTE((warn_unused_result));
63
65 override PALUDIS_ATTRIBUTE((warn_unused_result));
66
67 std::string split_debug_location() const
68 override PALUDIS_ATTRIBUTE((warn_unused_result));
69
70 void merge(const MergeParams &) override;
71
72 public:
73 ///\name Basic operations
74 ///\{
75
76 ///\since 0.42
78 ~FakeInstalledRepository() override;
79
80 ///\}
81
83
84 bool some_ids_might_not_be_masked() const override;
85
86 const bool is_unimportant() const override;
87
88 /* Keys */
89 const std::shared_ptr<const MetadataValueKey<std::string>> cross_compile_host_key() const override;
90 const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const override;
91 const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const override;
92 const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const override;
93 const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const override;
94 const std::shared_ptr<const MetadataValueKey<std::string>> tool_prefix_key() const override;
95
96 const std::shared_ptr<const Set<std::string> > maybe_expand_licence_nonrecursively(
97 const std::string &) const override;
98
99 ///\name RepositoryFactory functions
100 ///\{
101
102 static RepositoryName repository_factory_name(
103 const Environment * const env,
104 const std::function<std::string (const std::string &)> &);
105
106 static std::shared_ptr<Repository> repository_factory_create(
107 Environment * const env,
108 const std::function<std::string (const std::string &)> &);
109
110 static std::shared_ptr<const RepositoryNameSet> repository_factory_dependencies(
111 const Environment * const env,
112 const std::function<std::string (const std::string &)> &);
113
114 ///\}
115 };
116}
117
118#endif
Definition environment.hh:203
Definition fs_path.hh:34
const std::shared_ptr< const MetadataCollectionKey< Map< std::string, std::string > > > sync_host_key() const override
const bool is_unimportant() const override
void merge(const MergeParams &) override
bool some_ids_might_support_action(const SupportsActionTestBase &) const override
bool want_pre_post_phases() const override PALUDIS_ATTRIBUTE((warn_unused_result))
bool some_ids_might_not_be_masked() const override
const std::shared_ptr< const MetadataValueKey< FSPath > > installed_root_key() const override
FakeInstalledRepository(const FakeInstalledRepositoryParams &)
const std::shared_ptr< const Set< std::string > > maybe_expand_licence_nonrecursively(const std::string &) const override
bool is_suitable_destination_for(const std::shared_ptr< const PackageID > &) const override PALUDIS_ATTRIBUTE((warn_unused_result))
const std::shared_ptr< const MetadataValueKey< std::string > > format_key() const override
const std::shared_ptr< const MetadataValueKey< FSPath > > location_key() const override
FakeRepositoryBase(const Environment *const env, const RepositoryName &name, const RepositoryCapabilities &caps)
Definition map.hh:53
Definition metadata_key.hh:279
Definition metadata_key.hh:229
Definition named_value.hh:51
Definition pimp.hh:52
Definition repository.hh:522
Definition repository.hh:249
Definition set.hh:51
Definition action.hh:633
WrappedValue< RepositoryNameTag > RepositoryName
Definition name-fwd.hh:105
#define PALUDIS_ATTRIBUTE(x)
Definition attributes.hh:53
#define PALUDIS_VISIBLE
Definition attributes.hh:59
Definition about_metadata-fwd.hh:24
Definition fake_installed_repository.hh:39
Definition repository.hh:108