diff options
author | 2010-08-24 20:30:01 +0100 | |
---|---|---|
committer | 2010-08-26 11:36:11 +0100 | |
commit | d41dee1b4366dc685eaa2c435b01be03aef9929b (patch) | |
tree | 497cd2a6f67f2f3403db38d1285bd1775f4bee71 /paludis/repositories/gemcutter/gemcutter_id.hh | |
parent | 4fcfd14b89dcce88d0182ab89019f1b7d8fa70bf (diff) | |
download | paludis-d41dee1b4366dc685eaa2c435b01be03aef9929b.tar.gz paludis-d41dee1b4366dc685eaa2c435b01be03aef9929b.tar.xz |
Add GemcutterRepository
Diffstat (limited to 'paludis/repositories/gemcutter/gemcutter_id.hh')
-rw-r--r-- | paludis/repositories/gemcutter/gemcutter_id.hh | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/paludis/repositories/gemcutter/gemcutter_id.hh b/paludis/repositories/gemcutter/gemcutter_id.hh new file mode 100644 index 000000000..a0b7afd6c --- /dev/null +++ b/paludis/repositories/gemcutter/gemcutter_id.hh @@ -0,0 +1,115 @@ +/* vim: set sw=4 sts=4 et foldmethod=syntax : */ + +/* + * Copyright (c) 2010 Ciaran McCreesh + * + * This file is part of the Paludis package manager. Paludis is free software; + * you can redistribute it and/or modify it under the terms of the GNU General + * Public License version 2, as published by the Free Software Foundation. + * + * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_GEMCUTTER_GEMCUTTER_ID_HH +#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GEMCUTTER_GEMCUTTER_ID_HH 1 + +#include <paludis/repositories/gemcutter/gemcutter_id-fwd.hh> +#include <paludis/repositories/gemcutter/gemcutter_repository-fwd.hh> +#include <paludis/repositories/gemcutter/json_common.hh> +#include <paludis/util/named_value.hh> +#include <paludis/package_id.hh> +#include <paludis/name.hh> + +namespace paludis +{ + namespace n + { + typedef Name<struct environment_name> environment; + typedef Name<struct info_name> info; + typedef Name<struct repository_name> repository; + } + + namespace gemcutter_repository + { + struct GemcutterIDParams + { + NamedValue<n::environment, const Environment *> environment; + NamedValue<n::info, GemJSONInfo> info; + NamedValue<n::repository, const GemcutterRepository *> repository; + }; + + class PALUDIS_VISIBLE GemcutterID : + public PackageID, + private Pimp<GemcutterID> + { + private: + Pimp<GemcutterID>::ImpPtr & _imp; + + protected: + void need_keys_added() const; + void need_masks_added() const; + + public: + GemcutterID(const GemcutterIDParams &); + ~GemcutterID(); + + const std::string canonical_form(const PackageIDCanonicalForm) const; + const QualifiedPackageName name() const; + const VersionSpec version() const; + const std::shared_ptr<const Repository> repository() const; + virtual PackageDepSpec uniquely_identifying_spec() const; + + const std::shared_ptr<const MetadataValueKey<SlotName> > slot_key() const; + const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const PackageID> > > + virtual_for_key() const; + const std::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > keywords_key() const; + const std::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const; + const std::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const; + const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const PackageID> > > + contained_in_key() const; + const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > + dependencies_key() const; + const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > + build_dependencies_key() const; + const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > + run_dependencies_key() const; + const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > + post_dependencies_key() const; + const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > + suggested_dependencies_key() const; + const std::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > fetches_key() const; + const std::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const; + const std::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const; + const std::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const; + const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Contents> > > + contents_key() const; + const std::shared_ptr<const MetadataTimeKey> installed_time_key() const; + const std::shared_ptr<const MetadataValueKey<FSPath> > fs_location_key() const; + const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > behaviours_key() const; + const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key() const; + const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Choices> > > choices_key() const; + + bool supports_action(const SupportsActionTestBase &) const + PALUDIS_ATTRIBUTE((warn_unused_result)); + void perform_action(Action &) const PALUDIS_ATTRIBUTE((noreturn)); + + std::shared_ptr<const Set<std::string> > breaks_portage() const + PALUDIS_ATTRIBUTE((warn_unused_result)); + + bool arbitrary_less_than_comparison(const PackageID &) const + PALUDIS_ATTRIBUTE((warn_unused_result)); + std::size_t extra_hash_value() const + PALUDIS_ATTRIBUTE((warn_unused_result)); + }; + + } +} + +#endif |