aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-18 23:55:50 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-18 23:55:50 +0000
commitb12a4f151e0c16e18c08de5929922e4cd4d35165 (patch)
treecd410e5e465c10881752a718734554547d039e8d /paludis/repositories/e
parentcfbe6ed8eb60a9096d32856a8442a477137edb96 (diff)
downloadpaludis-b12a4f151e0c16e18c08de5929922e4cd4d35165.tar.gz
paludis-b12a4f151e0c16e18c08de5929922e4cd4d35165.tar.xz
Make metadata key general methods pure virtual.
Diffstat (limited to 'paludis/repositories/e')
-rw-r--r--paludis/repositories/e/dep_parser.cc18
-rw-r--r--paludis/repositories/e/e_choices_key.cc34
-rw-r--r--paludis/repositories/e/e_choices_key.hh9
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc3
-rw-r--r--paludis/repositories/e/e_key.cc400
-rw-r--r--paludis/repositories/e/e_key.hh91
-rw-r--r--paludis/repositories/e/eapi-fwd.hh4
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc4
-rw-r--r--paludis/repositories/e/ebuild_id.cc4
-rw-r--r--paludis/repositories/e/ebuild_id.hh4
-rw-r--r--paludis/repositories/e/exndbam_id.cc18
-rw-r--r--paludis/repositories/e/info_metadata_key.cc44
-rw-r--r--paludis/repositories/e/info_metadata_key.hh13
14 files changed, 523 insertions, 125 deletions
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 46a46c6ce..c65205183 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -288,8 +288,7 @@ namespace
struct AnnotationsKey :
MetadataSectionKey
{
- AnnotationsKey(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m) :
- MetadataSectionKey("Annotations", "Annotations", mkt_normal)
+ AnnotationsKey(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m)
{
for (Map<std::string, std::string>::ConstIterator k(m->begin()), k_end(m->end()) ;
k != k_end ; ++k)
@@ -299,6 +298,21 @@ namespace
void need_keys_added() const
{
}
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "Annotations";
+ }
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "Annotations";
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return mkt_normal;
+ }
};
void set_annotations(std::tr1::shared_ptr<DepSpec> & spec, const std::tr1::shared_ptr<const Map<std::string, std::string> > & m)
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 9fba4dd64..c2ca3e6c5 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -64,13 +64,21 @@ namespace paludis
const std::tr1::shared_ptr<const ERepository> maybe_e_repository;
const std::tr1::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > maybe_descriptions;
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i,
const std::tr1::shared_ptr<const ERepository> & p,
- const std::tr1::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > & d) :
+ const std::tr1::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > & d,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
maybe_e_repository(p),
- maybe_descriptions(d)
+ maybe_descriptions(d),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -82,9 +90,7 @@ EChoicesKey::EChoicesKey(
const std::string & r, const std::string & h, const MetadataKeyType t,
const std::tr1::shared_ptr<const ERepository> & p,
const std::tr1::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > & d) :
- MetadataValueKey<std::tr1::shared_ptr<const Choices> > (r, h, t),
- PrivateImplementationPattern<EChoicesKey>(new Implementation<EChoicesKey>(e, i, p, d)),
- _imp(PrivateImplementationPattern<EChoicesKey>::_imp)
+ PrivateImplementationPattern<EChoicesKey>(new Implementation<EChoicesKey>(e, i, p, d, r, h, t))
{
}
@@ -481,3 +487,21 @@ EChoicesKey::value() const
return _imp->value;
}
+const std::string
+EChoicesKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EChoicesKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EChoicesKey::type() const
+{
+ return _imp->type;
+}
+
diff --git a/paludis/repositories/e/e_choices_key.hh b/paludis/repositories/e/e_choices_key.hh
index 6d48372ab..c5f4eb7e2 100644
--- a/paludis/repositories/e/e_choices_key.hh
+++ b/paludis/repositories/e/e_choices_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 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
@@ -37,9 +37,6 @@ namespace paludis
public MetadataValueKey<std::tr1::shared_ptr<const Choices> >,
private PrivateImplementationPattern<EChoicesKey>
{
- private:
- PrivateImplementationPattern<EChoicesKey>::ImpPtr & _imp;
-
public:
EChoicesKey(
const Environment * const,
@@ -53,6 +50,10 @@ namespace paludis
~EChoicesKey();
const std::tr1::shared_ptr<const Choices> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index fa90edc52..f05cd824d 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -339,8 +339,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->src_uri()->name().empty())
if ((_imp->dir / vars->src_uri()->name()).exists())
{
- _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), vars->src_uri()->name(),
- vars->src_uri()->description(),
+ _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), vars->src_uri(),
file_contents(_imp->dir / vars->src_uri()->name()), mkt_dependencies));
add_metadata_key(_imp->src_uri);
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 6fd9877d0..e72c141c2 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -57,8 +57,10 @@ using namespace paludis::erepository;
EMutableRepositoryMaskInfoKey::EMutableRepositoryMaskInfoKey(const std::tr1::shared_ptr<const ERepositoryID> &,
const std::string & r, const std::string & h, const std::tr1::shared_ptr<const RepositoryMaskInfo> & v, const MetadataKeyType t) :
- MetadataValueKey<std::tr1::shared_ptr<const RepositoryMaskInfo> > (r, h, t),
- _value(v)
+ _value(v),
+ _r(r),
+ _h(h),
+ _t(t)
{
}
@@ -78,6 +80,24 @@ EMutableRepositoryMaskInfoKey::set_value(const std::tr1::shared_ptr<const Reposi
_value = v;
}
+const std::string
+EMutableRepositoryMaskInfoKey::raw_name() const
+{
+ return _r;
+}
+
+const std::string
+EMutableRepositoryMaskInfoKey::human_name() const
+{
+ return _h;
+}
+
+MetadataKeyType
+EMutableRepositoryMaskInfoKey::type() const
+{
+ return _t;
+}
+
namespace paludis
{
template <>
@@ -91,14 +111,22 @@ namespace paludis
mutable std::tr1::function<void () throw ()> value_used;
const std::tr1::shared_ptr<const DependencyLabelSequence> labels;
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
Implementation(
const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
- const std::tr1::shared_ptr<const DependencyLabelSequence> & s) :
+ const std::tr1::shared_ptr<const DependencyLabelSequence> & s,
+ const std::string & r, const std::string & h, const MetadataKeyType & t) :
env(e),
id(i),
string_value(v),
- labels(s)
+ labels(s),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -109,9 +137,7 @@ EDependenciesKey::EDependenciesKey(
const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v,
const std::tr1::shared_ptr<const DependencyLabelSequence> & l, const MetadataKeyType t) :
- MetadataSpecTreeKey<DependencySpecTree>(r, h, t),
- PrivateImplementationPattern<EDependenciesKey>(new Implementation<EDependenciesKey>(e, id, v, l)),
- _imp(PrivateImplementationPattern<EDependenciesKey>::_imp)
+ PrivateImplementationPattern<EDependenciesKey>(new Implementation<EDependenciesKey>(e, id, v, l, r, h, t))
{
}
@@ -162,6 +188,24 @@ EDependenciesKey::pretty_print_flat(const DependencySpecTree::ItemFormatter & f)
return stringify(p);
}
+const std::string
+EDependenciesKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EDependenciesKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EDependenciesKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -174,11 +218,19 @@ namespace paludis
mutable std::tr1::shared_ptr<const LicenseSpecTree> value;
mutable std::tr1::function<void () throw ()> value_used;
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
Implementation(const Environment * const e,
- const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -188,9 +240,7 @@ ELicenseKey::ELicenseKey(
const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataSpecTreeKey<LicenseSpecTree>(r, h, t),
- PrivateImplementationPattern<ELicenseKey>(new Implementation<ELicenseKey>(e, id, v)),
- _imp(PrivateImplementationPattern<ELicenseKey>::_imp)
+ PrivateImplementationPattern<ELicenseKey>(new Implementation<ELicenseKey>(e, id, v, r, h, t))
{
}
@@ -235,6 +285,24 @@ ELicenseKey::pretty_print_flat(const LicenseSpecTree::ItemFormatter & f) const
return stringify(p);
}
+const std::string
+ELicenseKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+ELicenseKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+ELicenseKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -242,15 +310,22 @@ namespace paludis
{
const Environment * const env;
const std::tr1::shared_ptr<const ERepositoryID> id;
+ const std::tr1::shared_ptr<const EAPIMetadataVariable> variable;
const std::string string_value;
+ const MetadataKeyType type;
+
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<const FetchableURISpecTree> value;
mutable std::tr1::shared_ptr<const URILabel> initial_label;
- Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i,
+ const std::tr1::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v,
+ const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ variable(m),
+ string_value(v),
+ type(t)
{
}
};
@@ -258,10 +333,8 @@ namespace paludis
EFetchableURIKey::EFetchableURIKey(const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & id,
- const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataSpecTreeKey<FetchableURISpecTree>(r, h, t),
- PrivateImplementationPattern<EFetchableURIKey>(new Implementation<EFetchableURIKey>(e, id, v)),
- _imp(PrivateImplementationPattern<EFetchableURIKey>::_imp)
+ const std::tr1::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v, const MetadataKeyType t) :
+ PrivateImplementationPattern<EFetchableURIKey>(new Implementation<EFetchableURIKey>(e, id, m, v, t))
{
}
@@ -336,6 +409,24 @@ EFetchableURIKey::initial_label() const
return _imp->initial_label;
}
+const std::string
+EFetchableURIKey::raw_name() const
+{
+ return _imp->variable->name();
+}
+
+const std::string
+EFetchableURIKey::human_name() const
+{
+ return _imp->variable->description();
+}
+
+MetadataKeyType
+EFetchableURIKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -347,10 +438,19 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<const SimpleURISpecTree> value;
- Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i,
+ const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -359,9 +459,7 @@ namespace paludis
ESimpleURIKey::ESimpleURIKey(const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataSpecTreeKey<SimpleURISpecTree>(r, h, t),
- PrivateImplementationPattern<ESimpleURIKey>(new Implementation<ESimpleURIKey>(e, id, v)),
- _imp(PrivateImplementationPattern<ESimpleURIKey>::_imp)
+ PrivateImplementationPattern<ESimpleURIKey>(new Implementation<ESimpleURIKey>(e, id, v, r, h, t))
{
}
@@ -400,6 +498,24 @@ ESimpleURIKey::pretty_print_flat(const SimpleURISpecTree::ItemFormatter & f) con
return stringify(p);
}
+const std::string
+ESimpleURIKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+ESimpleURIKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+ESimpleURIKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -411,10 +527,18 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<const PlainTextSpecTree> value;
- Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -423,9 +547,7 @@ namespace paludis
EPlainTextSpecKey::EPlainTextSpecKey(const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataSpecTreeKey<PlainTextSpecTree>(r, h, t),
- PrivateImplementationPattern<EPlainTextSpecKey>(new Implementation<EPlainTextSpecKey>(e, id, v)),
- _imp(PrivateImplementationPattern<EPlainTextSpecKey>::_imp)
+ PrivateImplementationPattern<EPlainTextSpecKey>(new Implementation<EPlainTextSpecKey>(e, id, v, r, h, t))
{
}
@@ -464,6 +586,24 @@ EPlainTextSpecKey::pretty_print_flat(const PlainTextSpecTree::ItemFormatter & f)
return stringify(p);
}
+const std::string
+EPlainTextSpecKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EPlainTextSpecKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EPlainTextSpecKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -475,10 +615,18 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<const PlainTextSpecTree> value;
- Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -487,9 +635,7 @@ namespace paludis
EMyOptionsKey::EMyOptionsKey(const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataSpecTreeKey<PlainTextSpecTree>(r, h, t),
- PrivateImplementationPattern<EMyOptionsKey>(new Implementation<EMyOptionsKey>(e, id, v)),
- _imp(PrivateImplementationPattern<EMyOptionsKey>::_imp)
+ PrivateImplementationPattern<EMyOptionsKey>(new Implementation<EMyOptionsKey>(e, id, v, r, h, t))
{
}
@@ -528,6 +674,24 @@ EMyOptionsKey::pretty_print_flat(const PlainTextSpecTree::ItemFormatter & f) con
return stringify(p);
}
+const std::string
+EMyOptionsKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EMyOptionsKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EMyOptionsKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -539,10 +703,18 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<const ProvideSpecTree> value;
- Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -550,9 +722,7 @@ namespace paludis
EProvideKey::EProvideKey(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataSpecTreeKey<ProvideSpecTree>(r, h, t),
- PrivateImplementationPattern<EProvideKey>(new Implementation<EProvideKey>(e, id, v)),
- _imp(PrivateImplementationPattern<EProvideKey>::_imp)
+ PrivateImplementationPattern<EProvideKey>(new Implementation<EProvideKey>(e, id, v, r, h, t))
{
}
@@ -591,6 +761,24 @@ EProvideKey::pretty_print_flat(const ProvideSpecTree::ItemFormatter & f) const
return stringify(p);
}
+const std::string
+EProvideKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EProvideKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EProvideKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -603,10 +791,18 @@ namespace paludis
mutable std::tr1::shared_ptr<KeywordNameSet> value;
mutable std::tr1::function<void () throw ()> value_used;
- Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const Environment * const e, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const Environment * const e, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
id(i),
env(e),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -614,9 +810,7 @@ namespace paludis
EKeywordsKey::EKeywordsKey(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataCollectionKey<KeywordNameSet>(r, h, t),
- PrivateImplementationPattern<EKeywordsKey>(new Implementation<EKeywordsKey>(id, e, v)),
- _imp(PrivateImplementationPattern<EKeywordsKey>::_imp)
+ PrivateImplementationPattern<EKeywordsKey>(new Implementation<EKeywordsKey>(id, e, v, r, h, t))
{
}
@@ -665,6 +859,24 @@ EKeywordsKey::pretty_print_flat(const Formatter<KeywordName> & f) const
return result;
}
+const std::string
+EKeywordsKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EKeywordsKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EKeywordsKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -675,9 +887,17 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<Set<std::string> > value;
- Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -685,9 +905,7 @@ namespace paludis
EStringSetKey::EStringSetKey(const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataCollectionKey<Set<std::string> >(r, h, t),
- PrivateImplementationPattern<EStringSetKey>(new Implementation<EStringSetKey>(id, v)),
- _imp(PrivateImplementationPattern<EStringSetKey>::_imp)
+ PrivateImplementationPattern<EStringSetKey>(new Implementation<EStringSetKey>(id, v, r, h, t))
{
}
@@ -709,6 +927,24 @@ EStringSetKey::value() const
return _imp->value;
}
+const std::string
+EStringSetKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EStringSetKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EStringSetKey::type() const
+{
+ return _imp->type;
+}
+
namespace
{
std::string format_string(const std::string & i, const Formatter<std::string> & f)
@@ -734,9 +970,17 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<Contents> value;
- Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const FSEntry & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const FSEntry & v,
+ const std::string & r, const std::string & h, const MetadataKeyType & t) :
id(i),
- filename(v)
+ filename(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -744,9 +988,7 @@ namespace paludis
EContentsKey::EContentsKey(const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
- MetadataValueKey<std::tr1::shared_ptr<const Contents> > (r, h, t),
- PrivateImplementationPattern<EContentsKey>(new Implementation<EContentsKey>(id, v)),
- _imp(PrivateImplementationPattern<EContentsKey>::_imp)
+ PrivateImplementationPattern<EContentsKey>(new Implementation<EContentsKey>(id, v, r, h, t))
{
}
@@ -809,6 +1051,24 @@ EContentsKey::value() const
return _imp->value;
}
+const std::string
+EContentsKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EContentsKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EContentsKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -819,9 +1079,17 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<time_t> value;
- Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const FSEntry & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const FSEntry & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
id(i),
- filename(v)
+ filename(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -829,9 +1097,7 @@ namespace paludis
EMTimeKey::EMTimeKey(const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
- MetadataTimeKey(r, h, t),
- PrivateImplementationPattern<EMTimeKey>(new Implementation<EMTimeKey>(id, v)),
- _imp(PrivateImplementationPattern<EMTimeKey>::_imp)
+ PrivateImplementationPattern<EMTimeKey>(new Implementation<EMTimeKey>(id, v, r, h, t))
{
}
@@ -863,3 +1129,21 @@ EMTimeKey::value() const
return *_imp->value;
}
+const std::string
+EMTimeKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EMTimeKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EMTimeKey::type() const
+{
+ return _imp->type;
+}
+
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index cd7c6299f..65e830b36 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 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
@@ -24,6 +24,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/set.hh>
#include <paludis/util/map-fwd.hh>
+#include <paludis/repositories/e/eapi-fwd.hh>
namespace paludis
{
@@ -38,6 +39,9 @@ namespace paludis
{
private:
std::tr1::shared_ptr<const RepositoryMaskInfo> _value;
+ const std::string _r;
+ const std::string _h;
+ const MetadataKeyType _t;
public:
EMutableRepositoryMaskInfoKey(const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -48,15 +52,16 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
void set_value(const std::tr1::shared_ptr<const RepositoryMaskInfo> &);
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EDependenciesKey :
public MetadataSpecTreeKey<DependencySpecTree>,
private PrivateImplementationPattern<EDependenciesKey>
{
- private:
- PrivateImplementationPattern<EDependenciesKey>::ImpPtr & _imp;
-
public:
EDependenciesKey(
const Environment * const,
@@ -77,19 +82,22 @@ namespace paludis
virtual const std::tr1::shared_ptr<const DependencyLabelSequence> initial_labels() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EFetchableURIKey :
public MetadataSpecTreeKey<FetchableURISpecTree>,
private PrivateImplementationPattern<EFetchableURIKey>
{
- private:
- PrivateImplementationPattern<EFetchableURIKey>::ImpPtr & _imp;
-
public:
EFetchableURIKey(const Environment * const,
const std::tr1::shared_ptr<const ERepositoryID> &,
- const std::string &, const std::string &, const std::string &, const MetadataKeyType);
+ const std::tr1::shared_ptr<const EAPIMetadataVariable> &,
+ const std::string &,
+ const MetadataKeyType);
~EFetchableURIKey();
virtual const std::tr1::shared_ptr<const FetchableURISpecTree> value() const
@@ -103,15 +111,16 @@ namespace paludis
virtual const std::tr1::shared_ptr<const URILabel> initial_label() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class ESimpleURIKey :
public MetadataSpecTreeKey<SimpleURISpecTree>,
private PrivateImplementationPattern<ESimpleURIKey>
{
- private:
- PrivateImplementationPattern<ESimpleURIKey>::ImpPtr & _imp;
-
public:
ESimpleURIKey(const Environment * const,
const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -126,15 +135,16 @@ namespace paludis
virtual std::string pretty_print_flat(const SimpleURISpecTree::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EPlainTextSpecKey :
public MetadataSpecTreeKey<PlainTextSpecTree>,
private PrivateImplementationPattern<EPlainTextSpecKey>
{
- private:
- PrivateImplementationPattern<EPlainTextSpecKey>::ImpPtr & _imp;
-
public:
EPlainTextSpecKey(const Environment * const,
const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -149,15 +159,16 @@ namespace paludis
virtual std::string pretty_print_flat(const PlainTextSpecTree::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EMyOptionsKey :
public MetadataSpecTreeKey<PlainTextSpecTree>,
private PrivateImplementationPattern<EMyOptionsKey>
{
- private:
- PrivateImplementationPattern<EMyOptionsKey>::ImpPtr & _imp;
-
public:
EMyOptionsKey(const Environment * const,
const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -172,15 +183,16 @@ namespace paludis
virtual std::string pretty_print_flat(const PlainTextSpecTree::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EProvideKey :
public MetadataSpecTreeKey<ProvideSpecTree>,
private PrivateImplementationPattern<EProvideKey>
{
- private:
- PrivateImplementationPattern<EProvideKey>::ImpPtr & _imp;
-
public:
EProvideKey(const Environment * const,
const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -195,15 +207,16 @@ namespace paludis
virtual std::string pretty_print_flat(const ProvideSpecTree::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class ELicenseKey :
public MetadataSpecTreeKey<LicenseSpecTree>,
private PrivateImplementationPattern<ELicenseKey>
{
- private:
- PrivateImplementationPattern<ELicenseKey>::ImpPtr & _imp;
-
public:
ELicenseKey(
const Environment * const,
@@ -219,15 +232,16 @@ namespace paludis
virtual std::string pretty_print_flat(const LicenseSpecTree::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EKeywordsKey :
public MetadataCollectionKey<KeywordNameSet>,
private PrivateImplementationPattern<EKeywordsKey>
{
- private:
- PrivateImplementationPattern<EKeywordsKey>::ImpPtr & _imp;
-
public:
EKeywordsKey(
const Environment * const,
@@ -240,15 +254,16 @@ namespace paludis
virtual std::string pretty_print_flat(const Formatter<KeywordName> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EStringSetKey :
public MetadataCollectionKey<Set<std::string> >,
private PrivateImplementationPattern<EStringSetKey>
{
- private:
- PrivateImplementationPattern<EStringSetKey>::ImpPtr & _imp;
-
public:
EStringSetKey(const std::tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
@@ -259,15 +274,16 @@ namespace paludis
virtual std::string pretty_print_flat(const Formatter<std::string> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EContentsKey :
public MetadataValueKey<std::tr1::shared_ptr<const Contents> >,
private PrivateImplementationPattern<EContentsKey>
{
- private:
- PrivateImplementationPattern<EContentsKey>::ImpPtr & _imp;
-
public:
EContentsKey(
const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -276,15 +292,16 @@ namespace paludis
const std::tr1::shared_ptr<const Contents> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EMTimeKey :
public MetadataTimeKey,
private PrivateImplementationPattern<EMTimeKey>
{
- private:
- PrivateImplementationPattern<EMTimeKey>::ImpPtr & _imp;
-
public:
EMTimeKey(const std::tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
@@ -292,6 +309,10 @@ namespace paludis
time_t value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/e/eapi-fwd.hh b/paludis/repositories/e/eapi-fwd.hh
index 27611bcb4..8dcfe9b67 100644
--- a/paludis/repositories/e/eapi-fwd.hh
+++ b/paludis/repositories/e/eapi-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 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
@@ -43,6 +43,8 @@ namespace paludis
class EAPIEbuildEnvironmentVariables;
class SupportedEAPI;
class EAPI;
+
+ class EAPIMetadataVariable;
}
}
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index e234098f8..bc854a4c8 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -490,7 +490,7 @@ EbuildMetadataCommand::load(const std::tr1::shared_ptr<const EbuildID> & id)
}
if (! m.src_uri()->name().empty())
- id->load_src_uri(m.src_uri()->name(), m.src_uri()->description(), get(keys, m.src_uri()->name()));
+ id->load_src_uri(m.src_uri(), get(keys, m.src_uri()->name()));
if (! m.homepage()->name().empty())
id->load_homepage(m.homepage()->name(), m.homepage()->description(), get(keys, m.homepage()->name()));
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index f7fbdf1be..493dcf2a4 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -178,7 +178,7 @@ namespace
id->set_slot(SlotName(lines.at(m.slot()->flat_list_index())));
if (-1 != m.src_uri()->flat_list_index() && ! m.src_uri()->name().empty())
- id->load_src_uri(m.src_uri()->name(), m.src_uri()->description(), lines.at(m.src_uri()->flat_list_index()));
+ id->load_src_uri(m.src_uri(), lines.at(m.src_uri()->flat_list_index()));
if (-1 != m.restrictions()->flat_list_index() && ! m.restrictions()->name().empty())
id->load_restrict(m.restrictions()->name(), m.restrictions()->description(), lines.at(m.restrictions()->flat_list_index()));
@@ -492,7 +492,7 @@ EbuildFlatMetadataCache::load(const std::tr1::shared_ptr<const EbuildID> & id)
id->set_slot(SlotName(keys[m.slot()->name()]));
if (! m.src_uri()->name().empty())
- id->load_src_uri(m.src_uri()->name(), m.src_uri()->description(), keys[m.src_uri()->name()]);
+ id->load_src_uri(m.src_uri(), keys[m.src_uri()->name()]);
if (! m.restrictions()->name().empty())
id->load_restrict(m.restrictions()->name(), m.restrictions()->description(), keys[m.restrictions()->name()]);
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 4dc62e7ee..09764755a 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -842,10 +842,10 @@ EbuildID::load_post_depend(const std::string & r, const std::string & h, const s
}
void
-EbuildID::load_src_uri(const std::string & r, const std::string & h, const std::string & v) const
+EbuildID::load_src_uri(const std::tr1::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), r, h, v, mkt_dependencies));
+ _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), m, v, mkt_dependencies));
add_metadata_key(_imp->src_uri);
}
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 5b5b73a3d..b6461f6f7 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 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
@@ -118,7 +118,7 @@ namespace paludis
void load_build_depend(const std::string &, const std::string &, const std::string &) const;
void load_run_depend(const std::string &, const std::string &, const std::string &) const;
void load_post_depend(const std::string &, const std::string &, const std::string &) const;
- void load_src_uri(const std::string &, const std::string &, const std::string &) const;
+ void load_src_uri(const std::tr1::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_homepage(const std::string &, const std::string &, const std::string &) const;
void load_license(const std::string &, const std::string &, const std::string &) const;
void load_provide(const std::string &, const std::string &, const std::string &) const;
diff --git a/paludis/repositories/e/exndbam_id.cc b/paludis/repositories/e/exndbam_id.cc
index 270a4a049..073781f9e 100644
--- a/paludis/repositories/e/exndbam_id.cc
+++ b/paludis/repositories/e/exndbam_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 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
@@ -58,7 +58,6 @@ namespace
public:
ExndbamContentsKey(const PackageID * const i, const NDBAM * const d) :
- MetadataValueKey<std::tr1::shared_ptr<const Contents> > ("contents", "Contents", mkt_internal),
_id(i),
_db(d)
{
@@ -79,6 +78,21 @@ namespace
);
return _v;
}
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "contents";
+ }
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "Contents";
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return mkt_internal;
+ }
};
}
diff --git a/paludis/repositories/e/info_metadata_key.cc b/paludis/repositories/e/info_metadata_key.cc
index 8bd84eb96..32ae6b833 100644
--- a/paludis/repositories/e/info_metadata_key.cc
+++ b/paludis/repositories/e/info_metadata_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 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
@@ -85,9 +85,7 @@ namespace paludis
}
InfoVarsMetadataKey::InfoVarsMetadataKey(const std::tr1::shared_ptr<const FSEntrySequence> & f) :
- MetadataCollectionKey<Set<std::string> >("info_vars", "Variable information names", mkt_internal),
- PrivateImplementationPattern<InfoVarsMetadataKey>(new Implementation<InfoVarsMetadataKey>(f)),
- _imp(PrivateImplementationPattern<InfoVarsMetadataKey>::_imp)
+ PrivateImplementationPattern<InfoVarsMetadataKey>(new Implementation<InfoVarsMetadataKey>(f))
{
}
@@ -121,10 +119,27 @@ InfoVarsMetadataKey::value() const
return _imp->value;
}
+const std::string
+InfoVarsMetadataKey::raw_name() const
+{
+ return "info_vars";
+}
+
+const std::string
+InfoVarsMetadataKey::human_name() const
+{
+ return "Variable information names";
+}
+
+MetadataKeyType
+InfoVarsMetadataKey::type() const
+{
+ return mkt_internal;
+}
+
InfoPkgsMetadataKey::InfoPkgsMetadataKey(const Environment * const e,
const std::tr1::shared_ptr<const FSEntrySequence> & f,
const ERepository * const r) :
- MetadataSectionKey("info_pkgs", "Package information", mkt_normal),
PrivateImplementationPattern<InfoPkgsMetadataKey>(new Implementation<InfoPkgsMetadataKey>(e, f, r)),
_imp(PrivateImplementationPattern<InfoPkgsMetadataKey>::_imp)
{
@@ -205,6 +220,25 @@ InfoVarsMetadataKey::pretty_print_flat(const Formatter<std::string> & f) const
return join(value()->begin(), value()->end(), " ", std::tr1::bind(&format_string, _1, f));
}
+const std::string
+InfoPkgsMetadataKey::raw_name() const
+{
+ return "info_pkgs";
+}
+
+const std::string
+InfoPkgsMetadataKey::human_name() const
+{
+ return "Package information";
+}
+
+MetadataKeyType
+InfoPkgsMetadataKey::type() const
+{
+ return mkt_internal;
+}
+
+
template class PrivateImplementationPattern<InfoPkgsMetadataKey>;
template class PrivateImplementationPattern<InfoVarsMetadataKey>;
diff --git a/paludis/repositories/e/info_metadata_key.hh b/paludis/repositories/e/info_metadata_key.hh
index 3010c431c..be1495ddd 100644
--- a/paludis/repositories/e/info_metadata_key.hh
+++ b/paludis/repositories/e/info_metadata_key.hh
@@ -30,22 +30,27 @@ namespace paludis
const std::tr1::shared_ptr<const FSEntrySequence> & f,
const ERepository * const);
~InfoPkgsMetadataKey();
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class InfoVarsMetadataKey :
public MetadataCollectionKey<Set<std::string> >,
private PrivateImplementationPattern<InfoVarsMetadataKey>
{
- private:
- PrivateImplementationPattern<InfoVarsMetadataKey>::ImpPtr & _imp;
-
public:
InfoVarsMetadataKey(const std::tr1::shared_ptr<const FSEntrySequence> &);
~InfoVarsMetadataKey();
const std::tr1::shared_ptr<const Set<std::string> > value() const;
- std::string pretty_print_flat(const Formatter<std::string> &) const;
+ std::string pretty_print_flat(const Formatter<std::string> &) const;
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}