aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/virtuals
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/virtuals
parentcfbe6ed8eb60a9096d32856a8442a477137edb96 (diff)
downloadpaludis-b12a4f151e0c16e18c08de5929922e4cd4d35165.tar.gz
paludis-b12a4f151e0c16e18c08de5929922e4cd4d35165.tar.xz
Make metadata key general methods pure virtual.
Diffstat (limited to 'paludis/repositories/virtuals')
-rw-r--r--paludis/repositories/virtuals/package_id.cc30
-rw-r--r--paludis/repositories/virtuals/package_id.hh6
2 files changed, 31 insertions, 5 deletions
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index b6504023c..99654af27 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -56,9 +56,12 @@ namespace paludis
const std::tr1::shared_ptr<const DependencyLabelSequence> labels;
const std::tr1::shared_ptr<const PackageDepSpec> spec;
+ const std::string raw_name;
+ const std::string human_name;
+
Implementation(const Environment * const e, const std::tr1::shared_ptr<const PackageID> & v,
const std::tr1::shared_ptr<const DependencyLabelSequence> & l,
- bool exact) :
+ bool exact, const std::string & h, const std::string & r) :
env(e),
value(new DependencySpecTree(make_shared_ptr(new AllDepSpec))),
labels(l),
@@ -76,7 +79,9 @@ namespace paludis
make_package_dep_spec()
.package(v->name())
))
- )
+ ),
+ raw_name(r),
+ human_name(h)
{
value->root()->append(spec);
}
@@ -87,8 +92,7 @@ VirtualsDepKey::VirtualsDepKey(const Environment * const e, const std::string &
const std::tr1::shared_ptr<const PackageID> & v,
const std::tr1::shared_ptr<const DependencyLabelSequence> & l,
const bool exact) :
- MetadataSpecTreeKey<DependencySpecTree>(r, h, mkt_dependencies),
- PrivateImplementationPattern<VirtualsDepKey>(new Implementation<VirtualsDepKey>(e, v, l, exact)),
+ PrivateImplementationPattern<VirtualsDepKey>(new Implementation<VirtualsDepKey>(e, v, l, exact, r, h)),
_imp(PrivateImplementationPattern<VirtualsDepKey>::_imp)
{
}
@@ -103,6 +107,24 @@ VirtualsDepKey::value() const
return _imp->value;
}
+const std::string
+VirtualsDepKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+VirtualsDepKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+VirtualsDepKey::type() const
+{
+ return mkt_dependencies;
+}
+
std::string
VirtualsDepKey::pretty_print(const DependencySpecTree::ItemFormatter & f) const
{
diff --git a/paludis/repositories/virtuals/package_id.hh b/paludis/repositories/virtuals/package_id.hh
index 91786a9b0..95c2ee7a8 100644
--- a/paludis/repositories/virtuals/package_id.hh
+++ b/paludis/repositories/virtuals/package_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
@@ -53,6 +53,10 @@ 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 VirtualsPackageID :