aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-16 09:17:23 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-16 09:17:23 +0000
commit830cd0e27f1acdbfdf66e6dd7a8630a35a6869b5 (patch)
tree1b486967b2b840ea87a8fbf311c13a823540116e
parent169e91b611f2a12b89467e03abb4c76ddbe3fe7e (diff)
downloadpaludis-830cd0e27f1acdbfdf66e6dd7a8630a35a6869b5.tar.gz
paludis-830cd0e27f1acdbfdf66e6dd7a8630a35a6869b5.tar.xz
Merge various metadata key things.
-rw-r--r--doc/api/cplusplus/examples/example_metadata_key.cc31
-rw-r--r--paludis/literal_metadata_key.cc146
-rw-r--r--paludis/literal_metadata_key.hh74
-rw-r--r--paludis/metadata_key-fwd.hh11
-rw-r--r--paludis/metadata_key.cc94
-rw-r--r--paludis/metadata_key.hh211
-rw-r--r--paludis/package_id.hh21
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc18
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh6
-rw-r--r--paludis/repositories/cran/cran_package_id.cc64
-rw-r--r--paludis/repositories/cran/cran_package_id.hh22
-rw-r--r--paludis/repositories/cran/cran_repository.cc32
-rw-r--r--paludis/repositories/cran/cran_repository.hh6
-rw-r--r--paludis/repositories/cran/keys.cc19
-rw-r--r--paludis/repositories/cran/keys.hh7
-rw-r--r--paludis/repositories/e/conditional_dep_spec.cc8
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc88
-rw-r--r--paludis/repositories/e/e_installed_repository_id.hh22
-rw-r--r--paludis/repositories/e/e_key.cc8
-rw-r--r--paludis/repositories/e/e_key.hh10
-rw-r--r--paludis/repositories/e/e_repository.cc102
-rw-r--r--paludis/repositories/e/e_repository.hh6
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc4
-rw-r--r--paludis/repositories/e/ebuild_id.cc44
-rw-r--r--paludis/repositories/e/ebuild_id.hh20
-rw-r--r--paludis/repositories/e/exndbam_id.cc6
-rw-r--r--paludis/repositories/e/exndbam_id.hh2
-rw-r--r--paludis/repositories/e/exndbam_repository.cc24
-rw-r--r--paludis/repositories/e/exndbam_repository.hh4
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc6
-rw-r--r--paludis/repositories/e/qa/metadata_keys.cc14
-rw-r--r--paludis/repositories/e/qa/spec_keys.cc12
-rw-r--r--paludis/repositories/e/vdb_id.cc2
-rw-r--r--paludis/repositories/e/vdb_id.hh2
-rw-r--r--paludis/repositories/e/vdb_repository.cc32
-rw-r--r--paludis/repositories/e/vdb_repository.hh4
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc12
-rw-r--r--paludis/repositories/fake/fake_installed_repository.hh6
-rw-r--r--paludis/repositories/fake/fake_package_id.cc42
-rw-r--r--paludis/repositories/fake/fake_package_id.hh22
-rw-r--r--paludis/repositories/fake/fake_repository.cc10
-rw-r--r--paludis/repositories/fake/fake_repository.hh6
-rw-r--r--paludis/repositories/gems/gem_specification.cc54
-rw-r--r--paludis/repositories/gems/gem_specification.hh20
-rw-r--r--paludis/repositories/gems/gem_specification_TEST.cc6
-rw-r--r--paludis/repositories/gems/gems_repository.cc32
-rw-r--r--paludis/repositories/gems/gems_repository.hh6
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc22
-rw-r--r--paludis/repositories/gems/installed_gems_repository.hh6
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc42
-rw-r--r--paludis/repositories/unpackaged/installed_id.hh20
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc17
-rw-r--r--paludis/repositories/unpackaged/installed_repository.hh6
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc44
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.hh22
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc36
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.hh6
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc14
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh6
-rw-r--r--paludis/repositories/virtuals/package_id.cc44
-rw-r--r--paludis/repositories/virtuals/package_id.hh22
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc12
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh6
-rw-r--r--paludis/repository.hh4
-rw-r--r--python/additional_tests.cc8
-rw-r--r--python/metadata_key.cc88
-rw-r--r--ruby/metadata_key.cc28
-rw-r--r--ruby/package_id.cc21
-rw-r--r--ruby/repository.cc4
-rw-r--r--src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc12
-rw-r--r--src/clients/inquisitio/key_extractor.cc12
-rw-r--r--src/clients/instruo/instruo.cc16
-rw-r--r--src/clients/paludis/applets.cc14
-rw-r--r--src/clients/paludis/info.cc14
-rw-r--r--src/clients/qualudis/qualudis.cc12
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc2
-rw-r--r--src/output/console_query_task.cc12
-rw-r--r--src/output/mask_displayer.cc12
78 files changed, 891 insertions, 1091 deletions
diff --git a/doc/api/cplusplus/examples/example_metadata_key.cc b/doc/api/cplusplus/examples/example_metadata_key.cc
index 05c2b64..7a057f7 100644
--- a/doc/api/cplusplus/examples/example_metadata_key.cc
+++ b/doc/api/cplusplus/examples/example_metadata_key.cc
@@ -52,27 +52,28 @@ namespace
{
}
- void visit(const MetadataStringKey & key)
+ void visit(const MetadataValueKey<std::string> & key)
{
- cout << indent << left << setw(30) << " Class:" << " " << "MetadataStringKey" << endl;
+ cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<std::string>" << endl;
cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
}
- void visit(const MetadataSizeKey & key)
+ void visit(const MetadataValueKey<long> & key)
{
- cout << indent << left << setw(30) << " Class:" << " " << "MetadataSizeKey" << endl;
+ cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<long>" << endl;
cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
}
- void visit(const MetadataFSEntryKey & key)
+ void visit(const MetadataValueKey<FSEntry> & key)
{
- cout << indent << left << setw(30) << " Class:" << " " << "MetadataFSEntryKey" << endl;
+ cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<FSEntry>" << endl;
cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
}
- void visit(const MetadataPackageIDKey & key)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & key)
{
- cout << indent << left << setw(30) << " Class:" << " " << "MetadataPackageIDKey" << endl;
+ cout << indent << left << setw(30) << " Class:" << " " <<
+ "MetadataValueKey<tr1::shared_ptr<const PackageID> >" << endl;
cout << indent << left << setw(30) << " Value:" << " " << *key.value() << endl;
}
@@ -88,20 +89,22 @@ namespace
cout << indent << left << setw(30) << " Value:" << " " << buf << endl;
}
- void visit(const MetadataContentsKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > &)
{
- cout << indent << left << setw(30) << " Class:" << " " << "MetadataContentsKey" << endl;
+ cout << indent << left << setw(30) << " Class:" << " " <<
+ "MetadataValueKey<tr1::shared_ptr<const Contents> > " << endl;
/* We won't display the contents of the contents key here, since
* it involves creating another visitor. See \ref
* example_contents.cc "example_contents.cc" for that. */
}
- void visit(const MetadataRepositoryMaskInfoKey & key)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > & key)
{
- cout << indent << left << setw(30) << " Class:" << " " << "MetadataRepositoryMaskInfoKey" << endl;
+ cout << indent << left << setw(30) << " Class:" << " " <<
+ "MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> >" << endl;
- /* MetadataRepositoryMaskInfoKey::value() can return a zero
- * pointer. Other keys can't. */
+ /* MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> >::value()
+ * can return a zero pointer. Other keys can't. */
if (key.value())
{
cout << indent << left << setw(30) << " Mask file:" << " " << (*key.value())[k::mask_file()] << endl;
diff --git a/paludis/literal_metadata_key.cc b/paludis/literal_metadata_key.cc
index 74698a1..91f9afa 100644
--- a/paludis/literal_metadata_key.cc
+++ b/paludis/literal_metadata_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -27,45 +27,13 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/formatter.hh>
#include <paludis/package_id.hh>
+#include <paludis/action.hh>
using namespace paludis;
namespace paludis
{
template <>
- struct Implementation<LiteralMetadataStringKey>
- {
- const std::string value;
-
- Implementation(const std::string & v) :
- value(v)
- {
- }
- };
-
- template <>
- struct Implementation<LiteralMetadataFSEntryKey>
- {
- const FSEntry value;
-
- Implementation(const FSEntry & v) :
- value(v)
- {
- }
- };
-
- template <>
- struct Implementation<LiteralMetadataPackageIDKey>
- {
- const tr1::shared_ptr<const PackageID> value;
-
- Implementation(const tr1::shared_ptr<const PackageID> & v) :
- value(v)
- {
- }
- };
-
- template <>
struct Implementation<LiteralMetadataFSEntrySequenceKey>
{
const tr1::shared_ptr<const FSEntrySequence> value;
@@ -86,60 +54,20 @@ namespace paludis
{
}
};
-}
-
-LiteralMetadataStringKey::LiteralMetadataStringKey(const std::string & h, const std::string & r,
- const MetadataKeyType t, const std::string & v) :
- MetadataStringKey(h, r, t),
- PrivateImplementationPattern<LiteralMetadataStringKey>(new Implementation<LiteralMetadataStringKey>(v)),
- _imp(PrivateImplementationPattern<LiteralMetadataStringKey>::_imp)
-{
-}
-
-LiteralMetadataStringKey::~LiteralMetadataStringKey()
-{
-}
-
-const std::string
-LiteralMetadataStringKey::value() const
-{
- return _imp->value;
-}
-
-LiteralMetadataFSEntryKey::LiteralMetadataFSEntryKey(const std::string & h, const std::string & r,
- const MetadataKeyType t, const FSEntry & v) :
- MetadataFSEntryKey(h, r, t),
- PrivateImplementationPattern<LiteralMetadataFSEntryKey>(new Implementation<LiteralMetadataFSEntryKey>(v)),
- _imp(PrivateImplementationPattern<LiteralMetadataFSEntryKey>::_imp)
-{
-}
-
-LiteralMetadataFSEntryKey::~LiteralMetadataFSEntryKey()
-{
-}
-
-const FSEntry
-LiteralMetadataFSEntryKey::value() const
-{
- return _imp->value;
-}
-LiteralMetadataPackageIDKey::LiteralMetadataPackageIDKey(const std::string & h, const std::string & r,
- const MetadataKeyType t, const tr1::shared_ptr<const PackageID> & v) :
- MetadataPackageIDKey(h, r, t),
- PrivateImplementationPattern<LiteralMetadataPackageIDKey>(new Implementation<LiteralMetadataPackageIDKey>(v)),
- _imp(PrivateImplementationPattern<LiteralMetadataPackageIDKey>::_imp)
-{
-}
-
-LiteralMetadataPackageIDKey::~LiteralMetadataPackageIDKey()
-{
-}
+#ifndef PALUDIS_NO_DOUBLE_TEMPLATE
+ template <>
+#endif
+ template <typename T_>
+ struct Implementation<LiteralMetadataValueKey<T_> >
+ {
+ const T_ value;
-const tr1::shared_ptr<const PackageID>
-LiteralMetadataPackageIDKey::value() const
-{
- return _imp->value;
+ Implementation(const T_ & v) :
+ value(v)
+ {
+ }
+ };
}
LiteralMetadataFSEntrySequenceKey::LiteralMetadataFSEntrySequenceKey(const std::string & h, const std::string & r,
@@ -208,3 +136,49 @@ LiteralMetadataStringSetKey::pretty_print_flat(const Formatter<std::string> & f)
return join(value()->begin(), value()->end(), " ", tr1::bind(&format_string, _1, f));
}
+ExtraLiteralMetadataValueKeyMethods<tr1::shared_ptr<const PackageID> >::~ExtraLiteralMetadataValueKeyMethods()
+{
+}
+
+std::string
+ExtraLiteralMetadataValueKeyMethods<tr1::shared_ptr<const PackageID> >::pretty_print(const Formatter<PackageID> & f) const
+{
+ tr1::shared_ptr<const PackageID> v(static_cast<const LiteralMetadataValueKey<tr1::shared_ptr<const PackageID> > *>(this)->value());
+ if (v->supports_action(SupportsActionTest<InstalledAction>()))
+ return f.format(*v, format::Installed());
+ else if (v->supports_action(SupportsActionTest<InstallAction>()))
+ {
+ if (v->masked())
+ return f.format(*v, format::Plain());
+ else
+ return f.format(*v, format::Installable());
+ }
+ else
+ return f.format(*v, format::Plain());
+}
+
+template <typename T_>
+LiteralMetadataValueKey<T_>::LiteralMetadataValueKey(const std::string & r, const std::string & h,
+ const MetadataKeyType t, const T_ & v) :
+ MetadataValueKey<T_>(r, h, t),
+ PrivateImplementationPattern<LiteralMetadataValueKey<T_> >(new Implementation<LiteralMetadataValueKey<T_> >(v)),
+ _imp(PrivateImplementationPattern<LiteralMetadataValueKey<T_ > >::_imp)
+{
+}
+
+template <typename T_>
+LiteralMetadataValueKey<T_>::~LiteralMetadataValueKey()
+{
+}
+
+template <typename T_>
+const T_
+LiteralMetadataValueKey<T_>::value() const
+{
+ return _imp->value;
+}
+
+template class LiteralMetadataValueKey<FSEntry>;
+template class LiteralMetadataValueKey<std::string>;
+template class LiteralMetadataValueKey<tr1::shared_ptr<const PackageID> >;
+
diff --git a/paludis/literal_metadata_key.hh b/paludis/literal_metadata_key.hh
index 39adcd5..ef63878 100644
--- a/paludis/literal_metadata_key.hh
+++ b/paludis/literal_metadata_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -40,84 +40,60 @@
namespace paludis
{
/**
- * A LiteralMetadataStringKey is a MetadataStringKey whose value is a
- * literal string that is known at construction time.
+ * Implement extra methods for LiteralMetadataValueKey.
*
- * \ingroup g_literal_metadata_key
+ * \ingroup g_metadata_key
* \since 0.26
*/
- class PALUDIS_VISIBLE LiteralMetadataStringKey :
- public MetadataStringKey,
- private PrivateImplementationPattern<LiteralMetadataStringKey>
+ template <typename T_>
+ class ExtraLiteralMetadataValueKeyMethods
{
- private:
- PrivateImplementationPattern<LiteralMetadataStringKey>::ImpPtr & _imp;
-
- public:
- ///\name Basic operations
- ///\{
-
- LiteralMetadataStringKey(const std::string &, const std::string &, const MetadataKeyType,
- const std::string &);
- ~LiteralMetadataStringKey();
-
- ///\}
-
- virtual const std::string value() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
/**
- * A LiteralMetadataFSEntryKey is a MetadataFSEntryKey whose value is a
- * literal FSEntry that is known at construction time.
+ * Implement extra methods for LiteralMetadataValueKey for PackageID.
*
- * \ingroup g_literal_metadata_key
+ * \ingroup g_metadata_key
* \since 0.26
*/
- class PALUDIS_VISIBLE LiteralMetadataFSEntryKey :
- public MetadataFSEntryKey,
- private PrivateImplementationPattern<LiteralMetadataFSEntryKey>
+ template <>
+ class ExtraLiteralMetadataValueKeyMethods<tr1::shared_ptr<const PackageID> > :
+ public virtual ExtraMetadataValueKeyMethods<tr1::shared_ptr<const PackageID> >
{
- private:
- PrivateImplementationPattern<LiteralMetadataFSEntryKey>::ImpPtr & _imp;
-
public:
- ///\name Basic operations
- ///\{
+ virtual ~ExtraLiteralMetadataValueKeyMethods() = 0;
- LiteralMetadataFSEntryKey(const std::string &, const std::string &, const MetadataKeyType,
- const FSEntry &);
- ~LiteralMetadataFSEntryKey();
-
- ///\}
-
- virtual const FSEntry value() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual std::string pretty_print(const Formatter<PackageID> &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
/**
- * A LiteralMetadataPackageIDKey is a MetadataPackageIDKey whose value is
- * known at construction time.
+ * A LiteralMetadataValueKey is a MetadataValueKey whose value is a
+ * copyable literal that is known at construction time.
*
* \ingroup g_literal_metadata_key
* \since 0.26
*/
- class PALUDIS_VISIBLE LiteralMetadataPackageIDKey :
- public MetadataPackageIDKey,
- private PrivateImplementationPattern<LiteralMetadataPackageIDKey>
+ template <typename T_>
+ class PALUDIS_VISIBLE LiteralMetadataValueKey :
+ public MetadataValueKey<T_>,
+ private PrivateImplementationPattern<LiteralMetadataValueKey<T_> >,
+ public ExtraLiteralMetadataValueKeyMethods<T_>
{
private:
- PrivateImplementationPattern<LiteralMetadataPackageIDKey>::ImpPtr & _imp;
+ typename PrivateImplementationPattern<LiteralMetadataValueKey<T_> >::ImpPtr & _imp;
public:
///\name Basic operations
///\{
- LiteralMetadataPackageIDKey(const std::string &, const std::string &, const MetadataKeyType,
- const tr1::shared_ptr<const PackageID> &);
- ~LiteralMetadataPackageIDKey();
+ LiteralMetadataValueKey(const std::string &, const std::string &, const MetadataKeyType,
+ const T_ &);
+ ~LiteralMetadataValueKey();
///\}
- virtual const tr1::shared_ptr<const PackageID> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const T_ value() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
/**
diff --git a/paludis/metadata_key-fwd.hh b/paludis/metadata_key-fwd.hh
index db69d35..e9ace57 100644
--- a/paludis/metadata_key-fwd.hh
+++ b/paludis/metadata_key-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -35,17 +35,12 @@ namespace paludis
class MetadataKeyVisitorTypes;
class MetadataKey;
- class MetadataPackageIDKey;
- class MetadataStringKey;
- class MetadataSizeKey;
- class MetadataContentsKey;
- class MetadataTimeKey;
- class MetadataRepositoryMaskInfoKey;
- class MetadataFSEntryKey;
class MetadataSectionKey;
+ class MetadataTimeKey;
template <typename C_> class MetadataCollectionKey;
template <> class MetadataCollectionKey<IUseFlagSet>;
template <typename C_> class MetadataSpecTreeKey;
+ template <typename V_> class MetadataValueKey;
#include <paludis/metadata_key-se.hh>
diff --git a/paludis/metadata_key.cc b/paludis/metadata_key.cc
index 9db72bc..c96c32e 100644
--- a/paludis/metadata_key.cc
+++ b/paludis/metadata_key.cc
@@ -79,18 +79,12 @@ MetadataKey::type() const
return _imp->type;
}
-MetadataStringKey::MetadataStringKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataKey(r, h, t)
-{
-}
-
-MetadataSizeKey::MetadataSizeKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
+MetadataSectionKey::MetadataSectionKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
MetadataKey(r, h, t)
{
}
-MetadataFSEntryKey::MetadataFSEntryKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataKey(r, h, t)
+MetadataSectionKey::~MetadataSectionKey()
{
}
@@ -99,88 +93,23 @@ MetadataTimeKey::MetadataTimeKey(const std::string & r, const std::string & h, c
{
}
-MetadataContentsKey::MetadataContentsKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataKey(r, h, t)
-{
-}
-
-MetadataPackageIDKey::MetadataPackageIDKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
+template <typename C_>
+MetadataValueKey<C_>::MetadataValueKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
MetadataKey(r, h, t)
{
}
-MetadataRepositoryMaskInfoKey::MetadataRepositoryMaskInfoKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
+template <typename C_>
+MetadataCollectionKey<C_>::MetadataCollectionKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
MetadataKey(r, h, t)
{
}
-namespace paludis
-{
- template <>
- struct Implementation<MetadataSectionKey>
- {
- mutable std::list<tr1::shared_ptr<const MetadataKey> > keys;
- };
-}
-
-MetadataSectionKey::MetadataSectionKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataKey(r, h, t),
- PrivateImplementationPattern<MetadataSectionKey>(new Implementation<MetadataSectionKey>),
- _imp(PrivateImplementationPattern<MetadataSectionKey>::_imp)
+ExtraMetadataValueKeyMethods<long>::~ExtraMetadataValueKeyMethods()
{
}
-MetadataSectionKey::~MetadataSectionKey()
-{
-}
-
-void
-MetadataSectionKey::add_metadata_key(const tr1::shared_ptr<const MetadataKey> & k) const
-{
- using namespace tr1::placeholders;
-
- if (indirect_iterator(_imp->keys.end()) != std::find_if(indirect_iterator(_imp->keys.begin()), indirect_iterator(_imp->keys.end()),
- tr1::bind(std::equal_to<std::string>(), k->raw_name(), tr1::bind(tr1::mem_fn(&MetadataKey::raw_name), _1))))
- throw ConfigurationError("Tried to add duplicate key '" + k->raw_name() + "'");
-
- _imp->keys.push_back(k);
-}
-
-MetadataSectionKey::MetadataConstIterator
-MetadataSectionKey::begin_metadata() const
-{
- need_keys_added();
- return MetadataConstIterator(_imp->keys.begin());
-}
-
-MetadataSectionKey::MetadataConstIterator
-MetadataSectionKey::end_metadata() const
-{
- need_keys_added();
- return MetadataConstIterator(_imp->keys.end());
-}
-
-MetadataSectionKey::MetadataConstIterator
-MetadataSectionKey::find_metadata(const std::string & s) const
-{
- using namespace tr1::placeholders;
-
- need_keys_added();
-
- // tr1::mem_fn on a sptr doesn't work with boost
- // return std::find_if(begin_metadata(), end_metadata(),
- // tr1::bind(std::equal_to<std::string>(), s, tr1::bind(tr1::mem_fn(&MetadataKey::raw_name), _1)));
-
- for (MetadataConstIterator i(begin_metadata()), i_end(end_metadata()) ;
- i != i_end ; ++i)
- if ((*i)->raw_name() == s)
- return i;
- return end_metadata();
-}
-
-template <typename C_>
-MetadataCollectionKey<C_>::MetadataCollectionKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataKey(r, h, t)
+ExtraMetadataValueKeyMethods<tr1::shared_ptr<const PackageID> >::~ExtraMetadataValueKeyMethods()
{
}
@@ -223,3 +152,10 @@ template class MetadataSpecTreeKey<DependencySpecTree>;
#endif
template class MetadataSpecTreeKey<SimpleURISpecTree>;
+template class MetadataValueKey<std::string>;
+template class MetadataValueKey<long>;
+template class MetadataValueKey<FSEntry>;
+template class MetadataValueKey<tr1::shared_ptr<const PackageID> >;
+template class MetadataValueKey<tr1::shared_ptr<const Contents> >;
+template class MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> >;
+
diff --git a/paludis/metadata_key.hh b/paludis/metadata_key.hh
index ede5400..0c901a0 100644
--- a/paludis/metadata_key.hh
+++ b/paludis/metadata_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -29,6 +29,7 @@
#include <paludis/contents-fwd.hh>
#include <paludis/repository-fwd.hh>
#include <paludis/formatter-fwd.hh>
+#include <paludis/metadata_key_holder.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/instantiation_policy.hh>
@@ -61,7 +62,6 @@ namespace paludis
VisitorTypes<
MetadataKeyVisitorTypes,
MetadataKey,
- MetadataPackageIDKey,
MetadataCollectionKey<UseFlagNameSet>,
MetadataCollectionKey<IUseFlagSet>,
MetadataCollectionKey<KeywordNameSet>,
@@ -74,12 +74,13 @@ namespace paludis
MetadataSpecTreeKey<SimpleURISpecTree>,
MetadataSpecTreeKey<ProvideSpecTree>,
MetadataSpecTreeKey<RestrictSpecTree>,
- MetadataStringKey,
- MetadataSizeKey,
- MetadataContentsKey,
+ MetadataValueKey<std::string>,
+ MetadataValueKey<long>,
+ MetadataValueKey<FSEntry>,
+ MetadataValueKey<tr1::shared_ptr<const PackageID> >,
+ MetadataValueKey<tr1::shared_ptr<const Contents> >,
+ MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> >,
MetadataTimeKey,
- MetadataRepositoryMaskInfoKey,
- MetadataFSEntryKey,
MetadataSectionKey
>
{
@@ -148,165 +149,104 @@ namespace paludis
};
/**
- * A MetadataPackageIDKey is a MetadataKey that has a PackageID as its
- * value.
+ * A MetadataSectionKey is a MetadataKey that holds a number of other
+ * MetadataKey instances.
*
* \ingroup g_metadata_key
* \since 0.26
* \nosubgrouping
*/
- class PALUDIS_VISIBLE MetadataPackageIDKey :
+ class PALUDIS_VISIBLE MetadataSectionKey :
public MetadataKey,
- public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataPackageIDKey>
+ public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataSectionKey>,
+ public MetadataKeyHolder
{
protected:
///\name Basic operations
///\{
- MetadataPackageIDKey(const std::string &, const std::string &, const MetadataKeyType);
+ MetadataSectionKey(const std::string &, const std::string &, const MetadataKeyType);
///\}
public:
- /**
- * Fetch our value.
- */
- virtual const tr1::shared_ptr<const PackageID> value() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- };
-
- /**
- * A MetadataStringKey is a MetadataKey that has a std::string as its
- * value.
- *
- * \ingroup g_metadata_key
- * \since 0.26
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE MetadataStringKey :
- public MetadataKey,
- public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataStringKey>
- {
- protected:
///\name Basic operations
///\{
- MetadataStringKey(const std::string &, const std::string &, const MetadataKeyType);
+ virtual ~MetadataSectionKey();
///\}
-
- public:
- /**
- * Fetch our value.
- */
- virtual const std::string value() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
/**
- * A MetadataSizeKey is a MetadataKey that represents the size of a file or
- * some files on disk in bytes.
+ * Extra methods for MetadataValueKey with certain item types.
*
* \ingroup g_metadata_key
* \since 0.26
- * \nosubgrouping
*/
- class PALUDIS_VISIBLE MetadataSizeKey :
- public MetadataKey,
- public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataSizeKey>
+ template <typename C_>
+ class ExtraMetadataValueKeyMethods
{
- protected:
- ///\name Basic operations
- ///\{
-
- MetadataSizeKey(const std::string &, const std::string &, const MetadataKeyType);
-
- ///\}
-
- public:
- /**
- * Fetch our raw value.
- */
- virtual long value() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- /**
- * Get a pretty string version of our value.
- */
- virtual std::string pretty_print() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
/**
- * A MetadataFSEntryKey is a MetadataKey that has an FSEntry as its value.
+ * Extra methods for MetadataValueKey with long value type.
*
* \ingroup g_metadata_key
* \since 0.26
- * \nosubgrouping
*/
- class PALUDIS_VISIBLE MetadataFSEntryKey :
- public MetadataKey,
- public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataFSEntryKey>
+ template <>
+ class PALUDIS_VISIBLE ExtraMetadataValueKeyMethods<long>
{
- protected:
- ///\name Basic operations
- ///\{
-
- MetadataFSEntryKey(const std::string &, const std::string &, const MetadataKeyType);
-
- ///\}
-
public:
+ virtual ~ExtraMetadataValueKeyMethods() = 0;
+
/**
- * Fetch our value.
+ * Return a formatted version of our value.
*/
- virtual const FSEntry value() const
+ virtual std::string pretty_print() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
/**
- * A MetadataTimeKey is a MetadataKey that has a time_t as its value.
+ * Extra methods for MetadataValueKey with PackageID value type.
*
* \ingroup g_metadata_key
* \since 0.26
- * \nosubgrouping
*/
- class PALUDIS_VISIBLE MetadataTimeKey :
- public MetadataKey,
- public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataTimeKey>
+ template <>
+ class PALUDIS_VISIBLE ExtraMetadataValueKeyMethods<tr1::shared_ptr<const PackageID> >
{
- protected:
- ///\name Basic operations
- ///\{
-
- MetadataTimeKey(const std::string &, const std::string &, const MetadataKeyType);
-
- ///\}
-
public:
+ virtual ~ExtraMetadataValueKeyMethods() = 0;
+
/**
- * Fetch our value.
+ * Return a formatted version of our value, using the supplied Formatter to
+ * format the item.
*/
- virtual time_t value() const
+ virtual std::string pretty_print(const Formatter<PackageID> &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
/**
- * A MetadataContentsKey is a MetadataKey that holds a Contents heirarchy.
+ * A MetadataValueKey is a MetadataKey that holds some simple type
+ * as its value.
*
* \ingroup g_metadata_key
* \since 0.26
* \nosubgrouping
*/
- class PALUDIS_VISIBLE MetadataContentsKey :
+ template <typename C_>
+ class PALUDIS_VISIBLE MetadataValueKey :
public MetadataKey,
- public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataContentsKey>
+ public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataValueKey<C_> >,
+ public virtual ExtraMetadataValueKeyMethods<C_>
{
protected:
///\name Basic operations
///\{
- MetadataContentsKey(const std::string &, const std::string &, const MetadataKeyType);
+ MetadataValueKey(const std::string &, const std::string &, const MetadataKeyType);
///\}
@@ -314,27 +254,26 @@ namespace paludis
/**
* Fetch our value.
*/
- virtual const tr1::shared_ptr<const Contents> value() const
+ virtual const C_ value() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
/**
- * A MetadataRepositoryMaskInfoKey is a MetadataKey that holds
- * RepositoryMaskInfo as its value.
+ * A MetadataTimeKey is a MetadataKey that has a time_t as its value.
*
* \ingroup g_metadata_key
* \since 0.26
* \nosubgrouping
*/
- class PALUDIS_VISIBLE MetadataRepositoryMaskInfoKey :
+ class PALUDIS_VISIBLE MetadataTimeKey :
public MetadataKey,
- public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataRepositoryMaskInfoKey>
+ public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataTimeKey>
{
protected:
///\name Basic operations
///\{
- MetadataRepositoryMaskInfoKey(const std::string &, const std::string &, const MetadataKeyType);
+ MetadataTimeKey(const std::string &, const std::string &, const MetadataKeyType);
///\}
@@ -342,69 +281,11 @@ namespace paludis
/**
* Fetch our value.
*/
- virtual const tr1::shared_ptr<const RepositoryMaskInfo> value() const
+ virtual time_t value() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
/**
- * A MetadataSectionKey is a MetadataKey that holds a number of other
- * MetadataKey instances.
- *
- * \ingroup g_metadata_key
- * \since 0.26
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE MetadataSectionKey :
- public MetadataKey,
- public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataSectionKey>,
- private PrivateImplementationPattern<MetadataSectionKey>
- {
- private:
- PrivateImplementationPattern<MetadataSectionKey>::ImpPtr & _imp;
-
- protected:
- ///\name Basic operations
- ///\{
-
- MetadataSectionKey(const std::string &, const std::string &, const MetadataKeyType);
-
- ///\}
-
- /**
- * Add a new MetadataKey, which must not use the same raw name as
- * any previous MetadataKey added to this key.
- */
- virtual void add_metadata_key(const tr1::shared_ptr<const MetadataKey> &) const;
-
- /**
- * This method will be called before any of the metadata key
- * iteration methods does its work. It can be used by subclasses to
- * implement as-needed loading of keys.
- */
- virtual void need_keys_added() const = 0;
-
- public:
- ///\name Basic operations
- ///\{
-
- virtual ~MetadataSectionKey();
-
- ///\}
-
- ///\name Finding and iterating over metadata keys
- ///\{
-
- struct MetadataConstIteratorTag;
- typedef WrappedForwardIterator<MetadataConstIteratorTag, tr1::shared_ptr<const MetadataKey> > MetadataConstIterator;
-
- MetadataConstIterator begin_metadata() const PALUDIS_ATTRIBUTE((warn_unused_result));
- MetadataConstIterator end_metadata() const PALUDIS_ATTRIBUTE((warn_unused_result));
- MetadataConstIterator find_metadata(const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- ///\}
- };
-
- /**
* A MetadataCollectionKey is a MetadataKey that holds a Set of some kind of item
* as its value.
*
diff --git a/paludis/package_id.hh b/paludis/package_id.hh
index 96f9797..8f8bd4d 100644
--- a/paludis/package_id.hh
+++ b/paludis/package_id.hh
@@ -36,6 +36,7 @@
#include <paludis/metadata_key_holder.hh>
#include <paludis/name-fwd.hh>
#include <paludis/repository-fwd.hh>
+#include <paludis/contents-fwd.hh>
#include <paludis/version_spec-fwd.hh>
/** \file
@@ -158,7 +159,7 @@ namespace paludis
* (old-style) virtual for another package. This affects dependency
* resolution.
*/
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for_key() const = 0;
/**
* The keywords_key, if non-zero, is used by FindUnusedPackagesTask
@@ -188,7 +189,7 @@ namespace paludis
* The contained_in_key, if non-zero, indicates that a package is
* contained in another package. This affects dependency resolution.
*/
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > contained_in_key() const = 0;
/**
* The build_dependencies_key, if non-zero, indicates a package's
@@ -229,13 +230,13 @@ namespace paludis
* The short_description_key, if non-zero, provides a short (no more
* than a few hundred characters) description of a package.
*/
- virtual const tr1::shared_ptr<const MetadataStringKey> short_description_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const = 0;
/**
* The long_description_key, if non-zero, provides a long
* description of a package.
*/
- virtual const tr1::shared_ptr<const MetadataStringKey> long_description_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const = 0;
/**
* The contents_key, if non-zero, contains the contents of a
@@ -243,7 +244,7 @@ namespace paludis
* for installable packages, this means the files that will be
* installed (if known, which it may be for some binary packages).
*/
- virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > contents_key() const = 0;
/**
* The installed_time_key, if non-zero, contains the time a package
@@ -256,34 +257,34 @@ namespace paludis
* The source_origin_key, if non-zero, contains a string describing
* the source repository whence a package originated.
*/
- virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const = 0;
/**
* The binary_origin_key, if non-zero, contains a string describing
* the binary repository whence a package originated.
*/
- virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const = 0;
/**
* The fs_location_key, if non-zero, indicates the filesystem
* location (for example, the ebuild file or VDB directory) that
* best describes the location of a PackageID.
*/
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const = 0;
/**
* The size_of_download_required_key, if non-zero, contains a
* long integer representing the size of distfiles that still need
* to be downloaded.
*/
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_download_required_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const = 0;
/**
* The size_of_all_distfiles_key, if non-zero, contains a long
* integer representing the size of all distfiles used by the
* package with the current USE settings.
*/
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_all_distfiles_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const = 0;
///\}
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 67818f6..2e8db04 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2006, 2007 Danny van Dyk
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -68,18 +68,18 @@ namespace paludis
Implementation(const CRANInstalledRepositoryParams &);
~Implementation();
- tr1::shared_ptr<const MetadataFSEntryKey> location_key;
- tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key;
- tr1::shared_ptr<const MetadataStringKey> format_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
};
}
Implementation<CRANInstalledRepository>::Implementation(const CRANInstalledRepositoryParams & p) :
params(p),
has_ids(false),
- location_key(new LiteralMetadataFSEntryKey("location", "location", mkt_significant, params.location)),
- installed_root_key(new LiteralMetadataFSEntryKey("root", "root", mkt_normal, params.root)),
- format_key(new LiteralMetadataStringKey("format", "format", mkt_significant, "installed_cran"))
+ location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location", mkt_significant, params.location)),
+ installed_root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root", mkt_normal, params.root)),
+ format_key(new LiteralMetadataValueKey<std::string> ("format", "format", mkt_significant, "installed_cran"))
{
}
@@ -667,13 +667,13 @@ CRANInstalledRepository::need_keys_added() const
{
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
CRANInstalledRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
CRANInstalledRepository::installed_root_key() const
{
return _imp->installed_root_key;
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 1945b61..d3f7840 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2006 Danny van Dyk
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -136,8 +136,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
/**
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index f00aeca..dedde50 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2006, 2007 Danny van Dyk
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -63,11 +63,11 @@ namespace paludis
QualifiedPackageName name;
VersionSpec version;
- tr1::shared_ptr<LiteralMetadataFSEntryKey> fs_location_key;
- tr1::shared_ptr<LiteralMetadataStringKey> url_key;
- tr1::shared_ptr<LiteralMetadataStringKey> short_description_key;
- tr1::shared_ptr<LiteralMetadataStringKey> long_description_key;
- tr1::shared_ptr<LiteralMetadataStringKey> license_key;
+ tr1::shared_ptr<LiteralMetadataValueKey<FSEntry> > fs_location_key;
+ tr1::shared_ptr<LiteralMetadataValueKey<std::string> > url_key;
+ tr1::shared_ptr<LiteralMetadataValueKey<std::string> > short_description_key;
+ tr1::shared_ptr<LiteralMetadataValueKey<std::string> > long_description_key;
+ tr1::shared_ptr<LiteralMetadataValueKey<std::string> > license_key;
tr1::shared_ptr<PackageIDKey> contained_in_key;
tr1::shared_ptr<PackageIDSequenceKey> contains_key;
tr1::shared_ptr<DepKey> depends_key;
@@ -122,7 +122,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const tr1::shared_pt
return;
}
- _imp->fs_location_key.reset(new LiteralMetadataFSEntryKey("DescriptionFileLocation", "Description File Location",
+ _imp->fs_location_key.reset(new LiteralMetadataValueKey<FSEntry> ("DescriptionFileLocation", "Description File Location",
mkt_internal, f));
add_metadata_key(_imp->fs_location_key);
@@ -168,7 +168,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const tr1::shared_pt
{
/* License often isn't in the format the spec requires, so we can't parse it. */
Context local_context("When handling License: key:");
- _imp->license_key.reset(new LiteralMetadataStringKey("License", "License", mkt_dependencies, file.get("License")));
+ _imp->license_key.reset(new LiteralMetadataValueKey<std::string>("License", "License", mkt_dependencies, file.get("License")));
add_metadata_key(_imp->license_key);
}
@@ -176,27 +176,27 @@ CRANPackageID::CRANPackageID(const Environment * const env, const tr1::shared_pt
{
/* URL is also in stupid formats */
Context local_context("When handling URL: key:");
- _imp->url_key.reset(new LiteralMetadataStringKey("URL", "URL", mkt_significant, file.get("URL")));
+ _imp->url_key.reset(new LiteralMetadataValueKey<std::string>("URL", "URL", mkt_significant, file.get("URL")));
add_metadata_key(_imp->url_key);
}
if (! file.get("Title").empty())
{
Context local_context("When handling Title: key:");
- _imp->short_description_key.reset(new LiteralMetadataStringKey("Title", "Title", mkt_significant, file.get("Title")));
+ _imp->short_description_key.reset(new LiteralMetadataValueKey<std::string>("Title", "Title", mkt_significant, file.get("Title")));
add_metadata_key(_imp->short_description_key);
}
if (! file.get("Description").empty())
{
Context local_context("When handling Description: key:");
- _imp->long_description_key.reset(new LiteralMetadataStringKey("Description", "Description", mkt_normal, file.get("Description")));
+ _imp->long_description_key.reset(new LiteralMetadataValueKey<std::string>("Description", "Description", mkt_normal, file.get("Description")));
add_metadata_key(_imp->long_description_key);
}
else if (! file.get("BundleDescription").empty())
{
Context local_context("When handling BundleDescription: key:");
- _imp->long_description_key.reset(new LiteralMetadataStringKey("BundleDescription", "Bundle Description",
+ _imp->long_description_key.reset(new LiteralMetadataValueKey<std::string>("BundleDescription", "Bundle Description",
mkt_normal, file.get("BundleDescription")));
}
@@ -204,19 +204,19 @@ CRANPackageID::CRANPackageID(const Environment * const env, const tr1::shared_pt
{
Context local_context("When handling Date: key:");
/* no guarantee on the format */
- add_metadata_key(make_shared_ptr(new LiteralMetadataStringKey("Date", "Date", mkt_normal, file.get("Date"))));
+ add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("Date", "Date", mkt_normal, file.get("Date"))));
}
if (! file.get("Author").empty())
{
Context local_context("When handling Author: key:");
- add_metadata_key(make_shared_ptr(new LiteralMetadataStringKey("Author", "Author", mkt_author, file.get("Author"))));
+ add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("Author", "Author", mkt_author, file.get("Author"))));
}
if (! file.get("Maintainer").empty())
{
Context local_context("When handling Maintainer: key:");
- add_metadata_key(make_shared_ptr(new LiteralMetadataStringKey("Maintainer", "Maintainer", mkt_author, file.get("Maintainer"))));
+ add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("Maintainer", "Maintainer", mkt_author, file.get("Maintainer"))));
}
if (! file.get("Contains").empty())
@@ -251,7 +251,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const tr1::shared_pt
if (! file.get("SystemRequirements").empty())
{
Context local_context("When handling SystemRequirements: key:");
- add_metadata_key(make_shared_ptr(new LiteralMetadataStringKey("SystemRequirements", "System Requirements", mkt_normal,
+ add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("SystemRequirements", "System Requirements", mkt_normal,
file.get("SystemRequirements"))));
}
@@ -322,10 +322,10 @@ CRANPackageID::repository() const
return _imp->repository;
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
CRANPackageID::virtual_for_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> >
@@ -382,22 +382,22 @@ CRANPackageID::homepage_key() const
return tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
CRANPackageID::short_description_key() const
{
return _imp->short_description_key;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
CRANPackageID::long_description_key() const
{
return _imp->long_description_key;
}
-const tr1::shared_ptr<const MetadataContentsKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >
CRANPackageID::contents_key() const
{
- return tr1::shared_ptr<const MetadataContentsKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >();
}
const tr1::shared_ptr<const MetadataTimeKey>
@@ -406,16 +406,16 @@ CRANPackageID::installed_time_key() const
return tr1::shared_ptr<const MetadataTimeKey>();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
CRANPackageID::source_origin_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
CRANPackageID::binary_origin_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
std::size_t
@@ -525,26 +525,26 @@ CRANPackageID::contains_key() const
return _imp->contains_key;
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
CRANPackageID::contained_in_key() const
{
return _imp->contained_in_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
CRANPackageID::fs_location_key() const
{
return _imp->fs_location_key;
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
CRANPackageID::size_of_download_required_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
CRANPackageID::size_of_all_distfiles_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
diff --git a/paludis/repositories/cran/cran_package_id.hh b/paludis/repositories/cran/cran_package_id.hh
index 5f50ae5..e19649d 100644
--- a/paludis/repositories/cran/cran_package_id.hh
+++ b/paludis/repositories/cran/cran_package_id.hh
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2006 Danny van Dyk
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -57,7 +57,7 @@ namespace paludis
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > keywords_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagSet> > iuse_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const;
@@ -67,17 +67,17 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > fetches_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> short_description_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> long_description_key() const;
- virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > contents_key() const;
virtual const tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_download_required_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 20d1214..28ade05 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2006, 2007 Danny van Dyk
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -70,12 +70,12 @@ namespace paludis
Implementation(const CRANRepositoryParams &, const tr1::shared_ptr<Mutex> &);
~Implementation();
- tr1::shared_ptr<const MetadataFSEntryKey> location_key;
- tr1::shared_ptr<const MetadataFSEntryKey> distdir_key;
- tr1::shared_ptr<const MetadataStringKey> format_key;
- tr1::shared_ptr<const MetadataFSEntryKey> builddir_key;
- tr1::shared_ptr<const MetadataFSEntryKey> library_key;
- tr1::shared_ptr<const MetadataStringKey> sync_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > distdir_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > library_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > sync_key;
};
}
@@ -83,12 +83,12 @@ Implementation<CRANRepository>::Implementation(const CRANRepositoryParams & p, c
params(p),
big_nasty_mutex(m),
has_ids(false),
- location_key(new LiteralMetadataFSEntryKey("location", "location", mkt_significant, params.location)),
- distdir_key(new LiteralMetadataFSEntryKey("distdir", "distdir", mkt_normal, params.distdir)),
- format_key(new LiteralMetadataStringKey("format", "format", mkt_significant, "cran")),
- builddir_key(new LiteralMetadataFSEntryKey("builddir", "builddir", mkt_normal, params.builddir)),
- library_key(new LiteralMetadataFSEntryKey("library", "library", mkt_normal, params.library)),
- sync_key(new LiteralMetadataStringKey("sync", "sync", mkt_normal, params.sync))
+ location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location", mkt_significant, params.location)),
+ distdir_key(new LiteralMetadataValueKey<FSEntry> ("distdir", "distdir", mkt_normal, params.distdir)),
+ format_key(new LiteralMetadataValueKey<std::string> ("format", "format", mkt_significant, "cran")),
+ builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir", mkt_normal, params.builddir)),
+ library_key(new LiteralMetadataValueKey<FSEntry> ("library", "library", mkt_normal, params.library)),
+ sync_key(new LiteralMetadataValueKey<std::string> ("sync", "sync", mkt_normal, params.sync))
{
}
@@ -515,15 +515,15 @@ CRANRepository::need_keys_added() const
{
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
CRANRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
CRANRepository::installed_root_key() const
{
- return tr1::shared_ptr<const MetadataFSEntryKey>();
+ return tr1::shared_ptr<const MetadataValueKey<FSEntry> >();
}
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index 2355eeb..b76eb94 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2006 Danny van Dyk
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -123,8 +123,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
/**
diff --git a/paludis/repositories/cran/keys.cc b/paludis/repositories/cran/keys.cc
index edced01..6a52465 100644
--- a/paludis/repositories/cran/keys.cc
+++ b/paludis/repositories/cran/keys.cc
@@ -32,6 +32,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/stringify_formatter-impl.hh>
#include <paludis/formatter.hh>
+#include <paludis/action.hh>
using namespace paludis;
using namespace paludis::cranrepository;
@@ -68,7 +69,7 @@ PackageIDSequenceKey::pretty_print_flat(const Formatter<PackageID> & f) const
PackageIDKey::PackageIDKey(const std::string & r, const std::string & h,
const CRANPackageID * const v, const MetadataKeyType t) :
- MetadataPackageIDKey(r, h, t),
+ MetadataValueKey<tr1::shared_ptr<const PackageID> >(r, h, t),
_v(v)
{
}
@@ -79,6 +80,22 @@ PackageIDKey::value() const
return _v->shared_from_this();
}
+std::string
+PackageIDKey::pretty_print(const Formatter<PackageID> & f) const
+{
+ if (_v->supports_action(SupportsActionTest<InstalledAction>()))
+ return f.format(*_v, format::Installed());
+ else if (_v->supports_action(SupportsActionTest<InstallAction>()))
+ {
+ if (_v->masked())
+ return f.format(*_v, format::Plain());
+ else
+ return f.format(*_v, format::Installable());
+ }
+ else
+ return f.format(*_v, format::Plain());
+}
+
namespace paludis
{
template <>
diff --git a/paludis/repositories/cran/keys.hh b/paludis/repositories/cran/keys.hh
index 3c5b211..6180528 100644
--- a/paludis/repositories/cran/keys.hh
+++ b/paludis/repositories/cran/keys.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -52,7 +52,7 @@ namespace paludis
};
class PackageIDKey :
- public MetadataPackageIDKey
+ public MetadataValueKey<tr1::shared_ptr<const PackageID> >
{
private:
const CRANPackageID * const _v;
@@ -62,6 +62,9 @@ namespace paludis
virtual const tr1::shared_ptr<const PackageID> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print(const Formatter<PackageID> &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
class DepKey :
diff --git a/paludis/repositories/e/conditional_dep_spec.cc b/paludis/repositories/e/conditional_dep_spec.cc
index 33dfe38..3ec276f 100644
--- a/paludis/repositories/e/conditional_dep_spec.cc
+++ b/paludis/repositories/e/conditional_dep_spec.cc
@@ -67,8 +67,8 @@ namespace
flag = UseFlagName(s.substr(inverse ? 1 : 0, s.length() - (inverse ? 2 : 1)));
- add_metadata_key(make_shared_ptr(new LiteralMetadataStringKey("Flag", "Flag", mkt_normal, stringify(flag))));
- add_metadata_key(make_shared_ptr(new LiteralMetadataStringKey("Inverse", "Inverse", mkt_normal, stringify(inverse))));
+ add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string> ("Flag", "Flag", mkt_normal, stringify(flag))));
+ add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string> ("Inverse", "Inverse", mkt_normal, stringify(inverse))));
}
virtual std::string as_string() const
@@ -118,7 +118,7 @@ paludis::erepository::conditional_dep_spec_flag(const ConditionalDepSpec & spec)
ConditionalDepSpec::MetadataConstIterator i(spec.find_metadata("Flag"));
if (i == spec.end_metadata())
throw InternalError(PALUDIS_HERE, "Spec '" + stringify(spec) + "' has no Flag metadata");
- const MetadataStringKey * key(visitor_cast<const MetadataStringKey>(**i));
+ const MetadataValueKey<std::string> * key(visitor_cast<const MetadataValueKey<std::string> >(**i));
if (! key)
throw InternalError(PALUDIS_HERE, "Spec '" + stringify(spec) + "' has Flag metadata which is not a string");
return UseFlagName(key->value());
@@ -130,7 +130,7 @@ paludis::erepository::conditional_dep_spec_is_inverse(const ConditionalDepSpec &
ConditionalDepSpec::MetadataConstIterator i(spec.find_metadata("Inverse"));
if (i == spec.end_metadata())
throw InternalError(PALUDIS_HERE, "Spec '" + stringify(spec) + "' has no Inverse metadata");
- const MetadataStringKey * key(visitor_cast<const MetadataStringKey>(**i));
+ const MetadataValueKey<std::string> * key(visitor_cast<const MetadataValueKey<std::string> >(**i));
if (! key)
throw InternalError(PALUDIS_HERE, "Spec '" + stringify(spec) + "' has Inverse metadata which is not a string");
return destringify<bool>(key->value());
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index e154599..b69f5b3 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -76,7 +76,7 @@ namespace paludis
tr1::shared_ptr<const SlotName> slot;
tr1::shared_ptr<const EAPI> eapi;
- tr1::shared_ptr<const MetadataFSEntryKey> fs_location;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location;
tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameSet> > use;
tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > inherited;
tr1::shared_ptr<const MetadataCollectionKey<IUseFlagSet> > iuse;
@@ -88,21 +88,21 @@ namespace paludis
tr1::shared_ptr<const MetadataSpecTreeKey<RestrictSpecTree> > restrictions;
tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > src_uri;
tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage;
- tr1::shared_ptr<const MetadataStringKey> short_description;
- tr1::shared_ptr<const MetadataContentsKey> contents;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > short_description;
+ tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > contents;
tr1::shared_ptr<const MetadataTimeKey> installed_time;
- tr1::shared_ptr<const MetadataStringKey> source_origin;
- tr1::shared_ptr<const MetadataStringKey> binary_origin;
-
- tr1::shared_ptr<const MetadataStringKey> asflags;
- tr1::shared_ptr<const MetadataStringKey> cbuild;
- tr1::shared_ptr<const MetadataStringKey> cflags;
- tr1::shared_ptr<const MetadataStringKey> chost;
- tr1::shared_ptr<const MetadataStringKey> ctarget;
- tr1::shared_ptr<const MetadataStringKey> cxxflags;
- tr1::shared_ptr<const MetadataStringKey> ldflags;
- tr1::shared_ptr<const MetadataStringKey> pkgmanager;
- tr1::shared_ptr<const MetadataStringKey> vdb_format;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin;
+
+ tr1::shared_ptr<const MetadataValueKey<std::string> > asflags;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > cbuild;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > cflags;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > chost;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > ctarget;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > cxxflags;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > ldflags;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > pkgmanager;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > vdb_format;
tr1::shared_ptr<DependencyLabelSequence> build_dependencies_labels;
tr1::shared_ptr<DependencyLabelSequence> run_dependencies_labels;
@@ -155,7 +155,7 @@ EInstalledRepositoryID::need_keys_added() const
// at the top, other keys use it.
if (! _imp->fs_location)
{
- _imp->fs_location.reset(new LiteralMetadataFSEntryKey(fs_location_raw_name(), fs_location_human_name(),
+ _imp->fs_location.reset(new LiteralMetadataValueKey<FSEntry> (fs_location_raw_name(), fs_location_human_name(),
mkt_internal, _imp->dir));
add_metadata_key(_imp->fs_location);
}
@@ -286,7 +286,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->metadata_description.empty())
if ((_imp->dir / vars->metadata_description).exists())
{
- _imp->short_description.reset(new LiteralMetadataStringKey(vars->metadata_description,
+ _imp->short_description.reset(new LiteralMetadataValueKey<std::string> (vars->metadata_description,
vars->description_description, mkt_significant, file_contents(_imp->dir / vars->metadata_description)));
add_metadata_key(_imp->short_description);
}
@@ -308,76 +308,76 @@ EInstalledRepositoryID::need_keys_added() const
if ((_imp->dir / "REPOSITORY").exists())
{
- _imp->source_origin.reset(new LiteralMetadataStringKey("REPOSITORY", "Source repository",
+ _imp->source_origin.reset(new LiteralMetadataValueKey<std::string> ("REPOSITORY", "Source repository",
mkt_normal, file_contents(_imp->dir / "REPOSITORY")));
add_metadata_key(_imp->source_origin);
}
else if ((_imp->dir / "repository").exists())
{
- _imp->source_origin.reset(new LiteralMetadataStringKey("repository", "Source repository",
+ _imp->source_origin.reset(new LiteralMetadataValueKey<std::string> ("repository", "Source repository",
mkt_normal, file_contents(_imp->dir / "repository")));
add_metadata_key(_imp->source_origin);
}
if ((_imp->dir / "BINARY_REPOSITORY").exists())
{
- _imp->binary_origin.reset(new LiteralMetadataStringKey("BINARY_REPOSITORY", "Binary repository",
+ _imp->binary_origin.reset(new LiteralMetadataValueKey<std::string> ("BINARY_REPOSITORY", "Binary repository",
mkt_normal, file_contents(_imp->dir / "BINARY_REPOSITORY")));
add_metadata_key(_imp->binary_origin);
}
if ((_imp->dir / "ASFLAGS").exists())
{
- _imp->asflags.reset(new LiteralMetadataStringKey("ASFLAGS", "ASFLAGS",
+ _imp->asflags.reset(new LiteralMetadataValueKey<std::string> ("ASFLAGS", "ASFLAGS",
mkt_internal, file_contents(_imp->dir / "ASFLAGS")));
add_metadata_key(_imp->asflags);
}
if ((_imp->dir / "CBUILD").exists())
{
- _imp->cbuild.reset(new LiteralMetadataStringKey("CBUILD", "CBUILD",
+ _imp->cbuild.reset(new LiteralMetadataValueKey<std::string> ("CBUILD", "CBUILD",
mkt_internal, file_contents(_imp->dir / "CBUILD")));
add_metadata_key(_imp->cbuild);
}
if ((_imp->dir / "CFLAGS").exists())
{
- _imp->cflags.reset(new LiteralMetadataStringKey("CFLAGS", "CFLAGS",
+ _imp->cflags.reset(new LiteralMetadataValueKey<std::string> ("CFLAGS", "CFLAGS",
mkt_internal, file_contents(_imp->dir / "CFLAGS")));
add_metadata_key(_imp->cflags);
}
if ((_imp->dir / "CHOST").exists())
{
- _imp->chost.reset(new LiteralMetadataStringKey("CHOST", "CHOST",
+ _imp->chost.reset(new LiteralMetadataValueKey<std::string> ("CHOST", "CHOST",
mkt_internal, file_contents(_imp->dir / "CHOST")));
add_metadata_key(_imp->chost);
}
if ((_imp->dir / "CXXFLAGS").exists())
{
- _imp->cxxflags.reset(new LiteralMetadataStringKey("CXXFLAGS", "CXXFLAGS",
+ _imp->cxxflags.reset(new LiteralMetadataValueKey<std::string> ("CXXFLAGS", "CXXFLAGS",
mkt_internal, file_contents(_imp->dir / "CXXFLAGS")));
add_metadata_key(_imp->cxxflags);
}
if ((_imp->dir / "LDFLAGS").exists())
{
- _imp->ldflags.reset(new LiteralMetadataStringKey("LDFLAGS", "LDFLAGS",
+ _imp->ldflags.reset(new LiteralMetadataValueKey<std::string> ("LDFLAGS", "LDFLAGS",
mkt_internal, file_contents(_imp->dir / "LDFLAGS")));
add_metadata_key(_imp->ldflags);
}
if ((_imp->dir / "PKGMANAGER").exists())
{
- _imp->pkgmanager.reset(new LiteralMetadataStringKey("PKGMANAGER", "Installed using",
+ _imp->pkgmanager.reset(new LiteralMetadataValueKey<std::string> ("PKGMANAGER", "Installed using",
mkt_normal, file_contents(_imp->dir / "PKGMANAGER")));
add_metadata_key(_imp->pkgmanager);
}
if ((_imp->dir / "VDB_FORMAT").exists())
{
- _imp->vdb_format.reset(new LiteralMetadataStringKey("VDB_FORMAT", "VDB Format",
+ _imp->vdb_format.reset(new LiteralMetadataValueKey<std::string> ("VDB_FORMAT", "VDB Format",
mkt_internal, file_contents(_imp->dir / "VDB_FORMAT")));
add_metadata_key(_imp->vdb_format);
}
@@ -481,10 +481,10 @@ EInstalledRepositoryID::eapi() const
return _imp->eapi;
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
EInstalledRepositoryID::virtual_for_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> >
@@ -582,20 +582,20 @@ EInstalledRepositoryID::homepage_key() const
return _imp->homepage;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
EInstalledRepositoryID::short_description_key() const
{
need_keys_added();
return _imp->short_description;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
EInstalledRepositoryID::long_description_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataContentsKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >
EInstalledRepositoryID::contents_key() const
{
need_keys_added();
@@ -609,21 +609,21 @@ EInstalledRepositoryID::installed_time_key() const
return _imp->installed_time;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
EInstalledRepositoryID::source_origin_key() const
{
need_keys_added();
return _imp->source_origin;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
EInstalledRepositoryID::binary_origin_key() const
{
need_keys_added();
return _imp->binary_origin;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
EInstalledRepositoryID::fs_location_key() const
{
// Avoid loading whole metadata
@@ -631,7 +631,7 @@ EInstalledRepositoryID::fs_location_key() const
{
Lock l(_imp->mutex);
- _imp->fs_location.reset(new LiteralMetadataFSEntryKey(fs_location_raw_name(),
+ _imp->fs_location.reset(new LiteralMetadataValueKey<FSEntry> (fs_location_raw_name(),
fs_location_human_name(), mkt_internal, _imp->dir));
add_metadata_key(_imp->fs_location);
}
@@ -639,16 +639,16 @@ EInstalledRepositoryID::fs_location_key() const
return _imp->fs_location;
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
EInstalledRepositoryID::size_of_download_required_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
EInstalledRepositoryID::size_of_all_distfiles_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
@@ -784,10 +784,10 @@ EInstalledRepositoryID::contains_key() const
return tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> >();
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
EInstalledRepositoryID::contained_in_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index 64b9b4c..e905fff 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -58,7 +58,7 @@ namespace paludis
virtual const tr1::shared_ptr<const Repository> repository() const;
virtual const tr1::shared_ptr<const EAPI> eapi() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > keywords_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > eclass_keywords_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagSet> > iuse_key() const;
@@ -70,17 +70,17 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<RestrictSpecTree> > restrict_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > fetches_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> short_description_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> long_description_key() const;
- virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > contents_key() const;
virtual const tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_download_required_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameSet> > use_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > inherited_key() const;
@@ -98,7 +98,7 @@ namespace paludis
virtual std::string fs_location_raw_name() const = 0;
virtual std::string fs_location_human_name() const = 0;
virtual std::string contents_filename() const = 0;
- virtual tr1::shared_ptr<MetadataContentsKey> make_contents_key() const = 0;
+ virtual tr1::shared_ptr<MetadataValueKey<tr1::shared_ptr<const Contents> > > make_contents_key() const = 0;
};
}
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 3deac00..b8d74c5 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -53,7 +53,7 @@ using namespace paludis::erepository;
EMutableRepositoryMaskInfoKey::EMutableRepositoryMaskInfoKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string & r, const std::string & h, tr1::shared_ptr<const RepositoryMaskInfo> v, const MetadataKeyType t) :
- MetadataRepositoryMaskInfoKey(r, h, t),
+ MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > (r, h, t),
_value(v)
{
}
@@ -972,7 +972,7 @@ namespace paludis
EContentsKey::EContentsKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
- MetadataContentsKey(r, h, t),
+ MetadataValueKey<tr1::shared_ptr<const Contents> > (r, h, t),
PrivateImplementationPattern<EContentsKey>(new Implementation<EContentsKey>(id, v)),
_imp(PrivateImplementationPattern<EContentsKey>::_imp)
{
@@ -1113,7 +1113,7 @@ namespace paludis
EDistSizeKey::EDistSizeKey(const std::string & r, const std::string & h, const MetadataKeyType t,
const tr1::shared_ptr<const EFetchableURIKey> & s,
const tr1::shared_ptr<DistfilesSizeVisitor> & d) :
- MetadataSizeKey(r, h, t),
+ MetadataValueKey<long> (r, h, t),
PrivateImplementationPattern<EDistSizeKey>(new Implementation<EDistSizeKey>(s, d)),
_imp(PrivateImplementationPattern<EDistSizeKey>::_imp)
{
@@ -1123,7 +1123,7 @@ EDistSizeKey::~EDistSizeKey()
{
}
-long
+const long
EDistSizeKey::value() const
{
Lock l(_imp->value_mutex);
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index 755c3ce..d72cf74 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 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -33,7 +33,7 @@ namespace paludis
class ERepositoryID;
class EMutableRepositoryMaskInfoKey :
- public MetadataRepositoryMaskInfoKey
+ public MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> >
{
private:
tr1::shared_ptr<const RepositoryMaskInfo> _value;
@@ -287,7 +287,7 @@ namespace paludis
};
class EContentsKey :
- public MetadataContentsKey,
+ public MetadataValueKey<tr1::shared_ptr<const Contents> >,
private PrivateImplementationPattern<EContentsKey>
{
private:
@@ -320,7 +320,7 @@ namespace paludis
};
class EDistSizeKey:
- public MetadataSizeKey,
+ public MetadataValueKey<long>,
private PrivateImplementationPattern<EDistSizeKey>
{
private:
@@ -333,7 +333,7 @@ namespace paludis
~EDistSizeKey();
- long value() const
+ const long value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
std::string pretty_print() const
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index e311268..e444f38 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -150,7 +150,7 @@ namespace
query::InstalledAtRoot(_env->root()),
qo_order_by_version));
if (q->empty())
- key.reset(new LiteralMetadataStringKey(*i, *i, mkt_normal, "(none)"));
+ key.reset(new LiteralMetadataValueKey<std::string>(*i, *i, mkt_normal, "(none)"));
else
{
using namespace tr1::placeholders;
@@ -238,32 +238,32 @@ namespace paludis
void need_profiles() const;
void need_profiles_desc() const;
- tr1::shared_ptr<const MetadataStringKey> format_key;
- tr1::shared_ptr<const MetadataStringKey> layout_key;
- tr1::shared_ptr<const MetadataFSEntryKey> location_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > layout_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
tr1::shared_ptr<const MetadataCollectionKey<FSEntrySequence> > profiles_key;
- tr1::shared_ptr<const MetadataFSEntryKey> cache_key;
- tr1::shared_ptr<const MetadataFSEntryKey> write_cache_key;
- tr1::shared_ptr<const MetadataStringKey> append_repository_name_to_write_cache_key;
- tr1::shared_ptr<const MetadataStringKey> ignore_deprecated_profiles;
- tr1::shared_ptr<const MetadataFSEntryKey> names_cache_key;
- tr1::shared_ptr<const MetadataFSEntryKey> distdir_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > cache_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > write_cache_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > append_repository_name_to_write_cache_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > ignore_deprecated_profiles;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > names_cache_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > distdir_key;
tr1::shared_ptr<const MetadataCollectionKey<FSEntrySequence> > eclassdirs_key;
- tr1::shared_ptr<const MetadataFSEntryKey> securitydir_key;
- tr1::shared_ptr<const MetadataFSEntryKey> setsdir_key;
- tr1::shared_ptr<const MetadataFSEntryKey> newsdir_key;
- tr1::shared_ptr<const MetadataStringKey> sync_key;
- tr1::shared_ptr<const MetadataStringKey> sync_options_key;
- tr1::shared_ptr<const MetadataFSEntryKey> builddir_key;
- tr1::shared_ptr<const MetadataStringKey> master_repository_key;
- tr1::shared_ptr<const MetadataStringKey> eapi_when_unknown_key;
- tr1::shared_ptr<const MetadataStringKey> eapi_when_unspecified_key;
- tr1::shared_ptr<const MetadataStringKey> profile_eapi_key;
- tr1::shared_ptr<const MetadataStringKey> use_manifest_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > securitydir_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > setsdir_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > newsdir_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > sync_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > sync_options_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > master_repository_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > eapi_when_unknown_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > eapi_when_unspecified_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > profile_eapi_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > use_manifest_key;
tr1::shared_ptr<const MetadataSectionKey> info_pkgs_key;
- tr1::shared_ptr<const MetadataStringKey> binary_destination_key;
- tr1::shared_ptr<const MetadataStringKey> binary_src_uri_prefix_key;
- tr1::shared_ptr<const MetadataStringKey> binary_keywords;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > binary_destination_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > binary_src_uri_prefix_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > binary_keywords;
};
Implementation<ERepository>::Implementation(ERepository * const r,
@@ -282,63 +282,63 @@ namespace paludis
params.layout)(r, params.location, entries_ptr, params.master_repository ?
make_shared_ptr(new FSEntry(params.master_repository->params().location)) :
tr1::shared_ptr<FSEntry>())),
- format_key(new LiteralMetadataStringKey("format", "format",
+ format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, params.entry_format)),
- layout_key(new LiteralMetadataStringKey("layout", "layout",
+ layout_key(new LiteralMetadataValueKey<std::string> ("layout", "layout",
mkt_normal, params.layout)),
- location_key(new LiteralMetadataFSEntryKey("location", "location",
+ location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
mkt_significant, params.location)),
profiles_key(new LiteralMetadataFSEntrySequenceKey(
"profiles", "profiles", mkt_normal, params.profiles)),
- cache_key(new LiteralMetadataFSEntryKey("cache", "cache",
+ cache_key(new LiteralMetadataValueKey<FSEntry> ("cache", "cache",
mkt_normal, params.cache)),
- write_cache_key(new LiteralMetadataFSEntryKey("write_cache", "write_cache",
+ write_cache_key(new LiteralMetadataValueKey<FSEntry> ("write_cache", "write_cache",
mkt_normal, params.write_cache)),
- append_repository_name_to_write_cache_key(new LiteralMetadataStringKey(
+ append_repository_name_to_write_cache_key(new LiteralMetadataValueKey<std::string> (
"append_repository_name_to_write_cache", "append_repository_name_to_write_cache",
mkt_normal, stringify(params.append_repository_name_to_write_cache))),
- ignore_deprecated_profiles(new LiteralMetadataStringKey(
+ ignore_deprecated_profiles(new LiteralMetadataValueKey<std::string> (
"ignore_deprecated_profiles", "ignore_deprecated_profiles",
mkt_normal, stringify(params.ignore_deprecated_profiles))),
- names_cache_key(new LiteralMetadataFSEntryKey(
+ names_cache_key(new LiteralMetadataValueKey<FSEntry> (
"names_cache", "names_cache", mkt_normal, params.names_cache)),
- distdir_key(new LiteralMetadataFSEntryKey(
+ distdir_key(new LiteralMetadataValueKey<FSEntry> (
"distdir", "distdir", mkt_normal, params.distdir)),
eclassdirs_key(new LiteralMetadataFSEntrySequenceKey(
"eclassdirs", "eclassdirs", mkt_normal, params.eclassdirs)),
- securitydir_key(new LiteralMetadataFSEntryKey(
+ securitydir_key(new LiteralMetadataValueKey<FSEntry> (
"securitydir", "securitydir", mkt_normal, params.securitydir)),
- setsdir_key(new LiteralMetadataFSEntryKey(
+ setsdir_key(new LiteralMetadataValueKey<FSEntry> (
"setsdir", "setsdir", mkt_normal, params.setsdir)),
- newsdir_key(new LiteralMetadataFSEntryKey(
+ newsdir_key(new LiteralMetadataValueKey<FSEntry> (
"newsdir", "newsdir", mkt_normal, params.newsdir)),
- sync_key(new LiteralMetadataStringKey(
+ sync_key(new LiteralMetadataValueKey<std::string> (
"sync", "sync", mkt_normal, params.sync)),
- sync_options_key(new LiteralMetadataStringKey(
+ sync_options_key(new LiteralMetadataValueKey<std::string> (
"sync_options", "sync_options", mkt_normal, params.sync_options)),
- builddir_key(new LiteralMetadataFSEntryKey(
+ builddir_key(new LiteralMetadataValueKey<FSEntry> (
"builddir", "builddir", mkt_normal, params.builddir)),
master_repository_key(params.master_repository ?
- tr1::shared_ptr<MetadataStringKey>(new LiteralMetadataStringKey(
+ tr1::shared_ptr<MetadataValueKey<std::string> >(new LiteralMetadataValueKey<std::string> (
"master_repository", "master_repository", mkt_normal, stringify(params.master_repository->name()))) :
- tr1::shared_ptr<MetadataStringKey>()),
- eapi_when_unknown_key(new LiteralMetadataStringKey(
+ tr1::shared_ptr<MetadataValueKey<std::string> >()),
+ eapi_when_unknown_key(new LiteralMetadataValueKey<std::string> (
"eapi_when_unknown", "eapi_when_unknown", mkt_normal, params.eapi_when_unknown)),
- eapi_when_unspecified_key(new LiteralMetadataStringKey(
+ eapi_when_unspecified_key(new LiteralMetadataValueKey<std::string> (
"eapi_when_unspecified", "eapi_when_unspecified", mkt_normal, params.eapi_when_unspecified)),
- profile_eapi_key(new LiteralMetadataStringKey(
+ profile_eapi_key(new LiteralMetadataValueKey<std::string> (
"profile_eapi", "profile_eapi", mkt_normal, params.profile_eapi)),
- use_manifest_key(new LiteralMetadataStringKey(
+ use_manifest_key(new LiteralMetadataValueKey<std::string> (
"use_manifest", "use_manifest", mkt_normal, stringify(params.use_manifest))),
info_pkgs_key((layout->info_packages_file(params.location / "profiles")).exists() ?
tr1::shared_ptr<MetadataSectionKey>(new PkgInfoSectionKey(
params.environment, layout->info_packages_file(params.location / "profiles"), params.profile_eapi)) :
tr1::shared_ptr<MetadataSectionKey>()),
- binary_destination_key(new LiteralMetadataStringKey(
+ binary_destination_key(new LiteralMetadataValueKey<std::string> (
"binary_destination", "binary_destination", mkt_normal, stringify(params.binary_destination))),
- binary_src_uri_prefix_key(new LiteralMetadataStringKey(
+ binary_src_uri_prefix_key(new LiteralMetadataValueKey<std::string> (
"binary_uri_prefix", "binary_uri_prefix", mkt_normal, params.binary_uri_prefix)),
- binary_keywords(new LiteralMetadataStringKey(
+ binary_keywords(new LiteralMetadataValueKey<std::string> (
"binary_keywords", "binary_keywords", mkt_normal, params.binary_keywords))
{
}
@@ -1399,15 +1399,15 @@ ERepository::need_keys_added() const
{
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
ERepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
ERepository::installed_root_key() const
{
- return tr1::shared_ptr<const MetadataFSEntryKey>();
+ return tr1::shared_ptr<const MetadataValueKey<FSEntry> >();
}
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 3a1be96..1e1e36c 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 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
@@ -243,8 +243,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
}
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index ee0fc48..2c2a865 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1137,7 +1137,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-0",
UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
TEST_CHECK(id);
- TEST_CHECK_EQUAL(visitor_cast<const MetadataStringKey>(**id->find_metadata("EAPI"))->value(), "0");
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
}
@@ -1212,7 +1212,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-1",
UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
TEST_CHECK(id);
- TEST_CHECK_EQUAL(visitor_cast<const MetadataStringKey>(**id->find_metadata("EAPI"))->value(), "1");
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
id->perform_action(action);
}
}
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index ed2f641..9b14a25 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -72,8 +72,8 @@ namespace paludis
mutable bool has_keys;
mutable bool has_masks;
- mutable tr1::shared_ptr<const LiteralMetadataFSEntryKey> fs_location;
- mutable tr1::shared_ptr<const LiteralMetadataStringKey> short_description;
+ mutable tr1::shared_ptr<const LiteralMetadataValueKey<FSEntry> > fs_location;
+ mutable tr1::shared_ptr<const LiteralMetadataValueKey<std::string> > short_description;
mutable tr1::shared_ptr<const EDependenciesKey> build_dependencies;
mutable tr1::shared_ptr<const EDependenciesKey> run_dependencies;
mutable tr1::shared_ptr<const EDependenciesKey> post_dependencies;
@@ -150,7 +150,7 @@ EbuildID::need_keys_added() const
// fs_location key could have been loaded by the ::fs_location_key() already.
if (! _imp->fs_location)
{
- _imp->fs_location.reset(new LiteralMetadataFSEntryKey("EBUILD", "Ebuild Location",
+ _imp->fs_location.reset(new LiteralMetadataValueKey<FSEntry> ("EBUILD", "Ebuild Location",
mkt_internal, _imp->ebuild));
add_metadata_key(_imp->fs_location);
}
@@ -256,7 +256,7 @@ EbuildID::need_keys_added() const
}
}
- add_metadata_key(make_shared_ptr(new LiteralMetadataStringKey("EAPI", "EAPI", mkt_internal, _imp->eapi->name)));
+ add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string> ("EAPI", "EAPI", mkt_internal, _imp->eapi->name)));
_imp->repository_mask = make_shared_ptr(new EMutableRepositoryMaskInfoKey(shared_from_this(), "repository_mask", "Repository masked",
tr1::static_pointer_cast<const ERepository>(repository())->repository_masked(*this), mkt_internal));
@@ -494,10 +494,10 @@ EbuildID::eapi() const
return _imp->eapi;
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
EbuildID::virtual_for_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> >
@@ -590,23 +590,23 @@ EbuildID::homepage_key() const
return _imp->homepage;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
EbuildID::short_description_key() const
{
need_keys_added();
return _imp->short_description;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
EbuildID::long_description_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataContentsKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >
EbuildID::contents_key() const
{
- return tr1::shared_ptr<const MetadataContentsKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >();
}
const tr1::shared_ptr<const MetadataTimeKey>
@@ -615,16 +615,16 @@ EbuildID::installed_time_key() const
return tr1::shared_ptr<const MetadataTimeKey>();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
EbuildID::source_origin_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
EbuildID::binary_origin_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
const tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
@@ -633,7 +633,7 @@ EbuildID::inherited_key() const
return _imp->inherited;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
EbuildID::fs_location_key() const
{
// Avoid loading whole metadata
@@ -641,21 +641,21 @@ EbuildID::fs_location_key() const
{
Lock l(_imp->mutex);
- _imp->fs_location.reset(new LiteralMetadataFSEntryKey("EBUILD", "Ebuild Location", mkt_internal, _imp->ebuild));
+ _imp->fs_location.reset(new LiteralMetadataValueKey<FSEntry> ("EBUILD", "Ebuild Location", mkt_internal, _imp->ebuild));
add_metadata_key(_imp->fs_location);
}
return _imp->fs_location;
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
EbuildID::size_of_download_required_key() const
{
need_keys_added();
return _imp->size_of_download_required;
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
EbuildID::size_of_all_distfiles_key() const
{
need_keys_added();
@@ -698,7 +698,7 @@ void
EbuildID::load_short_description(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->short_description.reset(new LiteralMetadataStringKey(r, h, mkt_significant, v));
+ _imp->short_description.reset(new LiteralMetadataValueKey<std::string> (r, h, mkt_significant, v));
add_metadata_key(_imp->short_description);
}
@@ -943,9 +943,9 @@ EbuildID::contains_key() const
return tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> >();
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
EbuildID::contained_in_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index c4ab9ad..4c5d410 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -63,7 +63,7 @@ namespace paludis
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > keywords_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > eclass_keywords_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagSet> > iuse_key() const;
@@ -74,17 +74,17 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > fetches_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> short_description_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> long_description_key() const;
- virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > contents_key() const;
virtual const tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_download_required_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
const tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > inherited_key() const;
const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const;
diff --git a/paludis/repositories/e/exndbam_id.cc b/paludis/repositories/e/exndbam_id.cc
index 73bec83..b036575 100644
--- a/paludis/repositories/e/exndbam_id.cc
+++ b/paludis/repositories/e/exndbam_id.cc
@@ -46,7 +46,7 @@ namespace
}
class ExndbamContentsKey :
- public MetadataContentsKey
+ public MetadataValueKey<tr1::shared_ptr<const Contents> >
{
private:
const PackageID * const _id;
@@ -56,7 +56,7 @@ namespace
public:
ExndbamContentsKey(const PackageID * const i, const NDBAM * const d) :
- MetadataContentsKey("contents", "Contents", mkt_internal),
+ MetadataValueKey<tr1::shared_ptr<const Contents> > ("contents", "Contents", mkt_internal),
_id(i),
_db(d)
{
@@ -107,7 +107,7 @@ ExndbamID::contents_filename() const
return "contents";
}
-tr1::shared_ptr<MetadataContentsKey>
+tr1::shared_ptr<MetadataValueKey<tr1::shared_ptr<const Contents> > >
ExndbamID::make_contents_key() const
{
return make_shared_ptr(new ExndbamContentsKey(this, _ndbam));
diff --git a/paludis/repositories/e/exndbam_id.hh b/paludis/repositories/e/exndbam_id.hh
index 7586b56..b0521c5 100644
--- a/paludis/repositories/e/exndbam_id.hh
+++ b/paludis/repositories/e/exndbam_id.hh
@@ -43,7 +43,7 @@ namespace paludis
virtual std::string fs_location_raw_name() const;
virtual std::string fs_location_human_name() const;
virtual std::string contents_filename() const;
- virtual tr1::shared_ptr<MetadataContentsKey> make_contents_key() const;
+ virtual tr1::shared_ptr<MetadataValueKey<tr1::shared_ptr<const Contents> > > make_contents_key() const;
};
}
}
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 075a118..f62eb52 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -66,24 +66,24 @@ namespace paludis
ExndbamRepositoryParams params;
mutable NDBAM ndbam;
- tr1::shared_ptr<const MetadataFSEntryKey> location_key;
- tr1::shared_ptr<const MetadataFSEntryKey> root_key;
- tr1::shared_ptr<const MetadataStringKey> format_key;
- tr1::shared_ptr<const MetadataFSEntryKey> world_key;
- tr1::shared_ptr<const MetadataFSEntryKey> builddir_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > world_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
Implementation(const ExndbamRepositoryParams & p) :
params(p),
ndbam(params.location, &supported_exndbam, "exndbam-1"),
- location_key(new LiteralMetadataFSEntryKey("location", "location",
+ location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
mkt_significant, params.location)),
- root_key(new LiteralMetadataFSEntryKey("root", "root",
+ root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root",
mkt_normal, params.root)),
- format_key(new LiteralMetadataStringKey("format", "format",
+ format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, "vdb")),
- world_key(new LiteralMetadataFSEntryKey("world", "world",
+ world_key(new LiteralMetadataValueKey<FSEntry> ("world", "world",
mkt_normal, params.world)),
- builddir_key(new LiteralMetadataFSEntryKey("builddir", "builddir",
+ builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
mkt_normal, params.builddir))
{
}
@@ -246,13 +246,13 @@ ExndbamRepositoryConfigurationError::ExndbamRepositoryConfigurationError(
{
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
ExndbamRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
ExndbamRepository::installed_root_key() const
{
return _imp->root_key;
diff --git a/paludis/repositories/e/exndbam_repository.hh b/paludis/repositories/e/exndbam_repository.hh
index 208cd46..1330b40 100644
--- a/paludis/repositories/e/exndbam_repository.hh
+++ b/paludis/repositories/e/exndbam_repository.hh
@@ -101,8 +101,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
///\name For use by ExndbamID
///\{
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index e890007..b4d3744 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -210,9 +210,9 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
Repository::MetadataConstIterator key(repo->find_metadata("location"));
if (repo->end_metadata() == key)
return "Einstalled repository has no location key";
- if (! visitor_cast<const MetadataFSEntryKey>(**key))
- return "Einstalled repository location key is not a MetadataFSEntryKey";
- return "O0;" + stringify(visitor_cast<const MetadataFSEntryKey>(**key)->value());
+ if (! visitor_cast<const MetadataValueKey<FSEntry> >(**key))
+ return "Einstalled repository location key is not a MetadataValueKey<FSEntry> ";
+ return "O0;" + stringify(visitor_cast<const MetadataValueKey<FSEntry> >(**key)->value());
}
}
else if (tokens[0] == "EVER")
diff --git a/paludis/repositories/e/qa/metadata_keys.cc b/paludis/repositories/e/qa/metadata_keys.cc
index a1cc102..8b585fc 100644
--- a/paludis/repositories/e/qa/metadata_keys.cc
+++ b/paludis/repositories/e/qa/metadata_keys.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
* Copyright (c) 2008 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -36,17 +36,17 @@ namespace
struct KeyValidator :
ConstVisitor<MetadataKeyVisitorTypes>
{
- void visit(const MetadataStringKey & k)
+ void visit(const MetadataValueKey<std::string> & k)
{
const std::string & PALUDIS_ATTRIBUTE((unused)) s(k.value());
}
- void visit(const MetadataSizeKey & k)
+ void visit(const MetadataValueKey<long> & k)
{
long PALUDIS_ATTRIBUTE((unused)) t(k.value());
}
- void visit(const MetadataPackageIDKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & k)
{
const tr1::shared_ptr<const PackageID> & PALUDIS_ATTRIBUTE((unused)) p(k.value());
}
@@ -56,17 +56,17 @@ namespace
time_t PALUDIS_ATTRIBUTE((unused)) t(k.value());
}
- void visit(const MetadataContentsKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > & k)
{
const tr1::shared_ptr<const Contents> & PALUDIS_ATTRIBUTE((unused)) c(k.value());
}
- void visit(const MetadataFSEntryKey & k)
+ void visit(const MetadataValueKey<FSEntry>& k)
{
const FSEntry & PALUDIS_ATTRIBUTE((unused)) c(k.value());
}
- void visit(const MetadataRepositoryMaskInfoKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > & k)
{
const tr1::shared_ptr<const RepositoryMaskInfo> & PALUDIS_ATTRIBUTE((unused)) i(k.value());
}
diff --git a/paludis/repositories/e/qa/spec_keys.cc b/paludis/repositories/e/qa/spec_keys.cc
index d3e8dd7..ed931d8 100644
--- a/paludis/repositories/e/qa/spec_keys.cc
+++ b/paludis/repositories/e/qa/spec_keys.cc
@@ -319,11 +319,11 @@ namespace
k->accept(*this);
}
- void visit(const MetadataStringKey &)
+ void visit(const MetadataValueKey<std::string> &)
{
}
- void visit(const MetadataSizeKey &)
+ void visit(const MetadataValueKey<long> &)
{
}
@@ -331,15 +331,15 @@ namespace
{
}
- void visit(const MetadataContentsKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > &)
{
}
- void visit(const MetadataPackageIDKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > &)
{
}
- void visit(const MetadataRepositoryMaskInfoKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > &)
{
}
@@ -367,7 +367,7 @@ namespace
{
}
- void visit(const MetadataFSEntryKey &)
+ void visit(const MetadataValueKey<FSEntry> &)
{
}
diff --git a/paludis/repositories/e/vdb_id.cc b/paludis/repositories/e/vdb_id.cc
index 0e09c28..fcd8bbe 100644
--- a/paludis/repositories/e/vdb_id.cc
+++ b/paludis/repositories/e/vdb_id.cc
@@ -50,7 +50,7 @@ VDBID::contents_filename() const
return "CONTENTS";
}
-tr1::shared_ptr<MetadataContentsKey>
+tr1::shared_ptr<MetadataValueKey<tr1::shared_ptr<const Contents> > >
VDBID::make_contents_key() const
{
return make_shared_ptr(new EContentsKey(shared_from_this(), "CONTENTS", "Contents",
diff --git a/paludis/repositories/e/vdb_id.hh b/paludis/repositories/e/vdb_id.hh
index 015b9bc..e7dd55e 100644
--- a/paludis/repositories/e/vdb_id.hh
+++ b/paludis/repositories/e/vdb_id.hh
@@ -38,7 +38,7 @@ namespace paludis
virtual std::string fs_location_raw_name() const;
virtual std::string fs_location_human_name() const;
virtual std::string contents_filename() const;
- virtual tr1::shared_ptr<MetadataContentsKey> make_contents_key() const;
+ virtual tr1::shared_ptr<MetadataValueKey<tr1::shared_ptr<const Contents> > > make_contents_key() const;
};
}
}
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 0320544..83996c2 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -101,13 +101,13 @@ namespace paludis
Implementation(const VDBRepository * const, const VDBRepositoryParams &, tr1::shared_ptr<Mutex> = make_shared_ptr(new Mutex));
~Implementation();
- tr1::shared_ptr<const MetadataFSEntryKey> location_key;
- tr1::shared_ptr<const MetadataFSEntryKey> root_key;
- tr1::shared_ptr<const MetadataStringKey> format_key;
- tr1::shared_ptr<const MetadataFSEntryKey> world_key;
- tr1::shared_ptr<const MetadataFSEntryKey> provides_cache_key;
- tr1::shared_ptr<const MetadataFSEntryKey> names_cache_key;
- tr1::shared_ptr<const MetadataFSEntryKey> builddir_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > world_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > provides_cache_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > names_cache_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
};
Implementation<VDBRepository>::Implementation(const VDBRepository * const r,
@@ -116,19 +116,19 @@ namespace paludis
big_nasty_mutex(m),
has_category_names(false),
names_cache(new RepositoryNameCache(p.names_cache, r)),
- location_key(new LiteralMetadataFSEntryKey("location", "location",
+ location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
mkt_significant, params.location)),
- root_key(new LiteralMetadataFSEntryKey("root", "root",
+ root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root",
mkt_normal, params.root)),
- format_key(new LiteralMetadataStringKey("format", "format",
+ format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, "vdb")),
- world_key(new LiteralMetadataFSEntryKey("world", "world",
+ world_key(new LiteralMetadataValueKey<FSEntry> ("world", "world",
mkt_normal, params.world)),
- provides_cache_key(new LiteralMetadataFSEntryKey("provides_cache", "provides_cache",
+ provides_cache_key(new LiteralMetadataValueKey<FSEntry> ("provides_cache", "provides_cache",
mkt_normal, params.provides_cache)),
- names_cache_key(new LiteralMetadataFSEntryKey("names_cache", "names_cache",
+ names_cache_key(new LiteralMetadataValueKey<FSEntry> ("names_cache", "names_cache",
mkt_normal, params.names_cache)),
- builddir_key(new LiteralMetadataFSEntryKey("builddir", "builddir",
+ builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
mkt_normal, params.builddir))
{
}
@@ -882,13 +882,13 @@ VDBRepository::need_keys_added() const
{
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
VDBRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
VDBRepository::installed_root_key() const
{
return _imp->root_key;
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index d7aaae0..795f67e 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -138,8 +138,8 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
/**
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 43cb6b2..be66ce9 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -39,13 +39,13 @@ namespace paludis
template <>
struct Implementation<FakeInstalledRepository>
{
- tr1::shared_ptr<const MetadataStringKey> format_key;
- tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key;
Implementation() :
- format_key(new LiteralMetadataStringKey(
+ format_key(new LiteralMetadataValueKey<std::string> (
"format", "format", mkt_significant, "installed_fake")),
- installed_root_key(new LiteralMetadataFSEntryKey(
+ installed_root_key(new LiteralMetadataValueKey<FSEntry> (
"installed_root", "installed_root", mkt_normal, FSEntry("/")))
{
}
@@ -188,13 +188,13 @@ FakeInstalledRepository::some_ids_might_support_action(const SupportsActionTestB
return q.result;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
FakeInstalledRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
FakeInstalledRepository::installed_root_key() const
{
return _imp->installed_root_key;
diff --git a/paludis/repositories/fake/fake_installed_repository.hh b/paludis/repositories/fake/fake_installed_repository.hh
index 6a99f9a..b51916c 100644
--- a/paludis/repositories/fake/fake_installed_repository.hh
+++ b/paludis/repositories/fake/fake_installed_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 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
@@ -69,8 +69,8 @@ namespace paludis
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
}
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 9a985d0..eaffb75 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -371,8 +371,8 @@ namespace paludis
mutable tr1::shared_ptr<DependencyLabelSequence> post_dependencies_labels;
mutable tr1::shared_ptr<DependencyLabelSequence> suggested_dependencies_labels;
- tr1::shared_ptr<LiteralMetadataPackageIDKey> package_id;
- tr1::shared_ptr<LiteralMetadataPackageIDKey> virtual_for;
+ tr1::shared_ptr<LiteralMetadataValueKey<tr1::shared_ptr<const PackageID> > > package_id;
+ tr1::shared_ptr<LiteralMetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for;
tr1::shared_ptr<FakeMetadataKeywordSetKey> keywords;
tr1::shared_ptr<FakeMetadataIUseSetKey> iuse;
tr1::shared_ptr<FakeMetadataSpecTreeKey<LicenseSpecTree> > license;
@@ -472,7 +472,7 @@ FakePackageID::repository() const
return _imp->repository;
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
FakePackageID::virtual_for_key() const
{
need_keys_added();
@@ -612,25 +612,25 @@ FakePackageID::homepage_key()
return _imp->homepage;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
FakePackageID::short_description_key() const
{
need_keys_added();
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
FakePackageID::long_description_key() const
{
need_keys_added();
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataContentsKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >
FakePackageID::contents_key() const
{
need_keys_added();
- return tr1::shared_ptr<const MetadataContentsKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >();
}
const tr1::shared_ptr<const MetadataTimeKey>
@@ -640,18 +640,18 @@ FakePackageID::installed_time_key() const
return tr1::shared_ptr<const MetadataTimeKey>();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
FakePackageID::source_origin_key() const
{
need_keys_added();
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
FakePackageID::binary_origin_key() const
{
need_keys_added();
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
void
@@ -924,28 +924,28 @@ FakePackageID::contains_key() const
return tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> >();
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
FakePackageID::contained_in_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
FakePackageID::fs_location_key() const
{
- return tr1::shared_ptr<const MetadataFSEntryKey>();
+ return tr1::shared_ptr<const MetadataValueKey<FSEntry> >();
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
FakePackageID::size_of_download_required_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
FakePackageID::size_of_all_distfiles_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
char
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index 473f7e4..787bd2d 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -202,7 +202,7 @@ namespace paludis
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > keywords_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagSet> > iuse_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const;
@@ -212,17 +212,17 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > fetches_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> short_description_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> long_description_key() const;
- virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > contents_key() const;
virtual const tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_download_required_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
const tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const;
const tr1::shared_ptr<FakeMetadataKeywordSetKey> keywords_key();
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 28f3c6f..35d092b 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -45,11 +45,11 @@ namespace paludis
tr1::shared_ptr<FakeRepository::VirtualsSequence> virtual_packages;
std::map<std::string, std::string> mirrors;
- tr1::shared_ptr<const MetadataStringKey> format_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
Implementation() :
virtual_packages(new FakeRepository::VirtualsSequence),
- format_key(new LiteralMetadataStringKey(
+ format_key(new LiteralMetadataValueKey<std::string> (
"format", "format", mkt_significant, "fake"))
{
mirrors.insert(std::make_pair("example", "http://fake-example/fake-example/"));
@@ -199,15 +199,15 @@ FakeRepository::end_mirrors(const std::string & s) const
return MirrorsConstIterator(_imp->mirrors.equal_range(s).second);
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
FakeRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
FakeRepository::installed_root_key() const
{
- return tr1::shared_ptr<const MetadataFSEntryKey>();
+ return tr1::shared_ptr<const MetadataValueKey<FSEntry> >();
}
diff --git a/paludis/repositories/fake/fake_repository.hh b/paludis/repositories/fake/fake_repository.hh
index 65ff6da..c0df74c 100644
--- a/paludis/repositories/fake/fake_repository.hh
+++ b/paludis/repositories/fake/fake_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 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
@@ -74,8 +74,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
}
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index 5ae4a92..e3faa30 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -48,11 +48,11 @@ namespace paludis
std::string platform;
std::string homepage;
- tr1::shared_ptr<LiteralMetadataStringKey> description_key;
- tr1::shared_ptr<LiteralMetadataStringKey> summary_key;
- tr1::shared_ptr<LiteralMetadataStringKey> authors_key;
- tr1::shared_ptr<LiteralMetadataStringKey> rubyforge_project_key;
- tr1::shared_ptr<LiteralMetadataFSEntryKey> fs_location_key;
+ tr1::shared_ptr<LiteralMetadataValueKey<std::string> > description_key;
+ tr1::shared_ptr<LiteralMetadataValueKey<std::string> > summary_key;
+ tr1::shared_ptr<LiteralMetadataValueKey<std::string> > authors_key;
+ tr1::shared_ptr<LiteralMetadataValueKey<std::string> > rubyforge_project_key;
+ tr1::shared_ptr<LiteralMetadataValueKey<FSEntry> > fs_location_key;
tr1::shared_ptr<const FSEntry> load_from_file;
@@ -205,19 +205,19 @@ namespace
{
std::string summary(required_text_only_key(n, "summary"));
if (! summary.empty())
- _imp->summary_key.reset(new LiteralMetadataStringKey("summary", "Summary", mkt_significant, summary));
+ _imp->summary_key.reset(new LiteralMetadataValueKey<std::string> ("summary", "Summary", mkt_significant, summary));
std::string description(optional_text_only_key(n, "description"));
if (! description.empty())
- _imp->description_key.reset(new LiteralMetadataStringKey("description", "Description", mkt_normal, description));
+ _imp->description_key.reset(new LiteralMetadataValueKey<std::string> ("description", "Description", mkt_normal, description));
std::string authors(optional_text_sequence_key(n, "authors"));
if (! authors.empty())
- _imp->authors_key.reset(new LiteralMetadataStringKey("authors", "Authors", mkt_normal, authors));
+ _imp->authors_key.reset(new LiteralMetadataValueKey<std::string> ("authors", "Authors", mkt_normal, authors));
std::string rubyforge_project(optional_text_sequence_key(n, "rubyforge_project"));
if (! rubyforge_project.empty())
- _imp->rubyforge_project_key.reset(new LiteralMetadataStringKey("rubyforge_project", "Rubyforge Project",
+ _imp->rubyforge_project_key.reset(new LiteralMetadataValueKey<std::string> ("rubyforge_project", "Rubyforge Project",
mkt_normal, rubyforge_project));
_imp->date = required_text_only_key(n, "date");
@@ -272,7 +272,7 @@ GemSpecification::GemSpecification(const Environment * const e, const tr1::share
_imp->name_part = stringify(q);
_imp->version = stringify(v);
_imp->load_from_file.reset(new FSEntry(f));
- _imp->fs_location_key.reset(new LiteralMetadataFSEntryKey("GEM", "Gem Location", mkt_internal, f));
+ _imp->fs_location_key.reset(new LiteralMetadataValueKey<FSEntry> ("GEM", "Gem Location", mkt_internal, f));
add_metadata_key(_imp->fs_location_key);
}
@@ -330,10 +330,10 @@ GemSpecification::repository() const
return _imp->repository;
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
GemSpecification::virtual_for_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> >
@@ -390,28 +390,28 @@ GemSpecification::suggested_dependencies_key() const
return tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
GemSpecification::short_description_key() const
{
return _imp->summary_key;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
GemSpecification::long_description_key() const
{
return _imp->description_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
GemSpecification::fs_location_key() const
{
return _imp->fs_location_key;
}
-const tr1::shared_ptr<const MetadataContentsKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >
GemSpecification::contents_key() const
{
- return tr1::shared_ptr<const MetadataContentsKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >();
}
const tr1::shared_ptr<const MetadataTimeKey>
@@ -420,16 +420,16 @@ GemSpecification::installed_time_key() const
return tr1::shared_ptr<const MetadataTimeKey>();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
GemSpecification::source_origin_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
GemSpecification::binary_origin_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
const tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> >
@@ -438,22 +438,22 @@ GemSpecification::contains_key() const
return tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> >();
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
GemSpecification::contained_in_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
GemSpecification::size_of_download_required_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
GemSpecification::size_of_all_distfiles_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
bool
diff --git a/paludis/repositories/gems/gem_specification.hh b/paludis/repositories/gems/gem_specification.hh
index ee1abfb..972c3ff 100644
--- a/paludis/repositories/gems/gem_specification.hh
+++ b/paludis/repositories/gems/gem_specification.hh
@@ -90,7 +90,7 @@ namespace paludis
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > keywords_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagSet> > iuse_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const;
@@ -100,19 +100,19 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > fetches_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> short_description_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> long_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > contained_in_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
- virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > contents_key() const;
virtual const tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_download_required_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/repositories/gems/gem_specification_TEST.cc b/paludis/repositories/gems/gem_specification_TEST.cc
index 7340df2..a4e8cc8 100644
--- a/paludis/repositories/gems/gem_specification_TEST.cc
+++ b/paludis/repositories/gems/gem_specification_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -70,8 +70,8 @@ namespace test_cases
TEST_CHECK_EQUAL(spec.long_description_key()->value(), "A longer description");
TEST_CHECK(spec.find_metadata("authors") != spec.end_metadata());
- TEST_CHECK(visitor_cast<const MetadataStringKey>(**spec.find_metadata("authors")));
- TEST_CHECK_EQUAL(visitor_cast<const MetadataStringKey>(**spec.find_metadata("authors"))->value(), "Fred, Barney");
+ TEST_CHECK(visitor_cast<const MetadataValueKey<std::string> >(**spec.find_metadata("authors")));
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**spec.find_metadata("authors"))->value(), "Fred, Barney");
#if 0
TEST_CHECK_EQUAL(spec.homepage(), "");
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 9153a7c..765139f 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -54,29 +54,29 @@ namespace paludis
mutable bool has_category_names;
mutable bool has_ids;
- tr1::shared_ptr<const MetadataFSEntryKey> location_key;
- tr1::shared_ptr<const MetadataFSEntryKey> install_dir_key;
- tr1::shared_ptr<const MetadataFSEntryKey> builddir_key;
- tr1::shared_ptr<const MetadataStringKey> sync_key;
- tr1::shared_ptr<const MetadataStringKey> sync_options_key;
- tr1::shared_ptr<const MetadataStringKey> format_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > install_dir_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > sync_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > sync_options_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
Implementation(const gems::RepositoryParams p, tr1::shared_ptr<Mutex> m = make_shared_ptr(new Mutex)) :
params(p),
big_nasty_mutex(m),
has_category_names(false),
has_ids(false),
- location_key(new LiteralMetadataFSEntryKey("location", "location",
+ location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
mkt_significant, params.location)),
- install_dir_key(new LiteralMetadataFSEntryKey("install_dir", "install_dir",
+ install_dir_key(new LiteralMetadataValueKey<FSEntry> ("install_dir", "install_dir",
mkt_normal, params.install_dir)),
- builddir_key(new LiteralMetadataFSEntryKey("builddir", "builddir",
+ builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
mkt_normal, params.builddir)),
- sync_key(new LiteralMetadataStringKey("sync", "sync",
+ sync_key(new LiteralMetadataValueKey<std::string> ("sync", "sync",
mkt_normal, params.sync)),
- sync_options_key(new LiteralMetadataStringKey(
+ sync_options_key(new LiteralMetadataValueKey<std::string> (
"sync_options", "sync_options", mkt_normal, params.sync_options)),
- format_key(new LiteralMetadataStringKey("format", "format",
+ format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, "gems"))
{
}
@@ -334,15 +334,15 @@ GemsRepository::need_keys_added() const
{
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
GemsRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
GemsRepository::installed_root_key() const
{
- return tr1::shared_ptr<const MetadataFSEntryKey>();
+ return tr1::shared_ptr<const MetadataValueKey<FSEntry> >();
}
diff --git a/paludis/repositories/gems/gems_repository.hh b/paludis/repositories/gems/gems_repository.hh
index e96113b..31bdb11 100644
--- a/paludis/repositories/gems/gems_repository.hh
+++ b/paludis/repositories/gems/gems_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -86,8 +86,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
}
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index cf0803e..4beece1 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -59,10 +59,10 @@ namespace paludis
mutable bool has_category_names;
mutable bool has_ids;
- tr1::shared_ptr<const MetadataFSEntryKey> install_dir_key;
- tr1::shared_ptr<const MetadataFSEntryKey> builddir_key;
- tr1::shared_ptr<const MetadataFSEntryKey> root_key;
- tr1::shared_ptr<const MetadataStringKey> format_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > install_dir_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
Implementation(const gems::InstalledRepositoryParams p,
tr1::shared_ptr<Mutex> m = make_shared_ptr(new Mutex)) :
@@ -70,13 +70,13 @@ namespace paludis
params(p),
has_category_names(false),
has_ids(false),
- install_dir_key(new LiteralMetadataFSEntryKey("install_dir", "install_dir",
+ install_dir_key(new LiteralMetadataValueKey<FSEntry> ("install_dir", "install_dir",
mkt_normal, params.install_dir)),
- builddir_key(new LiteralMetadataFSEntryKey("builddir", "builddir",
+ builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
mkt_normal, params.builddir)),
- root_key(new LiteralMetadataFSEntryKey(
+ root_key(new LiteralMetadataValueKey<FSEntry> (
"root", "root", mkt_normal, params.root)),
- format_key(new LiteralMetadataStringKey("format", "format",
+ format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, "gems"))
{
}
@@ -353,13 +353,13 @@ InstalledGemsRepository::need_keys_added() const
{
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
InstalledGemsRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
InstalledGemsRepository::installed_root_key() const
{
return _imp->root_key;
diff --git a/paludis/repositories/gems/installed_gems_repository.hh b/paludis/repositories/gems/installed_gems_repository.hh
index f180304..a608618 100644
--- a/paludis/repositories/gems/installed_gems_repository.hh
+++ b/paludis/repositories/gems/installed_gems_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -101,8 +101,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
}
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index 204dc58..3de0531 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -49,14 +49,14 @@ using namespace paludis::unpackaged_repositories;
namespace
{
class InstalledUnpackagedFSEntryKey :
- public MetadataFSEntryKey
+ public MetadataValueKey<FSEntry>
{
private:
const FSEntry _location;
public:
InstalledUnpackagedFSEntryKey(const FSEntry & l) :
- MetadataFSEntryKey("location", "Location", mkt_internal),
+ MetadataValueKey<FSEntry> ("location", "Location", mkt_internal),
_location(l)
{
}
@@ -83,7 +83,7 @@ namespace
}
class InstalledUnpackagedContentsKey :
- public MetadataContentsKey
+ public MetadataValueKey<tr1::shared_ptr<const Contents> >
{
private:
const PackageID * const _id;
@@ -93,7 +93,7 @@ namespace
public:
InstalledUnpackagedContentsKey(const PackageID * const i, const NDBAM * const d) :
- MetadataContentsKey("contents", "Contents", mkt_internal),
+ MetadataValueKey<tr1::shared_ptr<const Contents> > ("contents", "Contents", mkt_internal),
_id(i),
_db(d)
{
@@ -136,7 +136,7 @@ namespace
};
class InstalledUnpackagedStringKey :
- public MetadataStringKey
+ public MetadataValueKey<std::string>
{
private:
mutable tr1::shared_ptr<const std::string> _v;
@@ -145,7 +145,7 @@ namespace
public:
InstalledUnpackagedStringKey(const std::string & r, const std::string & h, const FSEntry & f, const MetadataKeyType t) :
- MetadataStringKey(r, h, t),
+ MetadataValueKey<std::string> (r, h, t),
_f(f)
{
}
@@ -391,10 +391,10 @@ InstalledUnpackagedID::repository() const
return _imp->env->package_database()->fetch_repository(_imp->repository_name);
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
InstalledUnpackagedID::virtual_for_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> >
@@ -421,10 +421,10 @@ InstalledUnpackagedID::contains_key() const
return tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> >();
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
InstalledUnpackagedID::contained_in_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> >
@@ -463,19 +463,19 @@ InstalledUnpackagedID::homepage_key() const
return tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
InstalledUnpackagedID::short_description_key() const
{
return _imp->description_key;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
InstalledUnpackagedID::long_description_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataContentsKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >
InstalledUnpackagedID::contents_key() const
{
return _imp->contents_key;
@@ -487,34 +487,34 @@ InstalledUnpackagedID::installed_time_key() const
return _imp->installed_time_key;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
InstalledUnpackagedID::source_origin_key() const
{
return _imp->source_origin_key;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
InstalledUnpackagedID::binary_origin_key() const
{
return _imp->binary_origin_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
InstalledUnpackagedID::fs_location_key() const
{
return _imp->fs_location_key;
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
InstalledUnpackagedID::size_of_download_required_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
InstalledUnpackagedID::size_of_all_distfiles_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
namespace
diff --git a/paludis/repositories/unpackaged/installed_id.hh b/paludis/repositories/unpackaged/installed_id.hh
index c1d8dc7..0e2ed5b 100644
--- a/paludis/repositories/unpackaged/installed_id.hh
+++ b/paludis/repositories/unpackaged/installed_id.hh
@@ -57,27 +57,27 @@ namespace paludis
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > keywords_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagSet> > iuse_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > contained_in_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > run_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > post_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > fetches_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> short_description_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> long_description_key() const;
- virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > contents_key() const;
virtual const tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_download_required_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 259785d..16f7e1b 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -62,18 +62,18 @@ namespace paludis
const InstalledUnpackagedRepositoryParams params;
mutable NDBAM ndbam;
- tr1::shared_ptr<const MetadataFSEntryKey> location_key;
- tr1::shared_ptr<const MetadataFSEntryKey> root_key;
- tr1::shared_ptr<const MetadataStringKey> format_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
Implementation(const InstalledUnpackagedRepositoryParams & p) :
params(p),
ndbam(p.location, &supported_installed_unpackaged, "installed_unpackaged-1"),
- location_key(new LiteralMetadataFSEntryKey("location", "location",
+ location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
mkt_significant, params.location)),
- root_key(new LiteralMetadataFSEntryKey("root", "root",
+ root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root",
mkt_normal, params.root)),
- format_key(new LiteralMetadataStringKey(
+ format_key(new LiteralMetadataValueKey<std::string> (
"format", "format", mkt_significant, "installed_unpackaged"))
{
}
@@ -413,16 +413,15 @@ InstalledUnpackagedRepository::need_keys_added() const
{
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
InstalledUnpackagedRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
InstalledUnpackagedRepository::installed_root_key() const
{
return _imp->root_key;
}
-
diff --git a/paludis/repositories/unpackaged/installed_repository.hh b/paludis/repositories/unpackaged/installed_repository.hh
index c316015..7cedefe 100644
--- a/paludis/repositories/unpackaged/installed_repository.hh
+++ b/paludis/repositories/unpackaged/installed_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -98,8 +98,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
}
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 41ed6ef..a417fb6 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -54,10 +54,10 @@ namespace paludis
tr1::shared_ptr<DependencyLabelSequence> build_dependencies_labels;
tr1::shared_ptr<DependencyLabelSequence> run_dependencies_labels;
- const tr1::shared_ptr<LiteralMetadataFSEntryKey> fs_location_key;
+ const tr1::shared_ptr<LiteralMetadataValueKey<FSEntry> > fs_location_key;
const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key;
const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > run_dependencies_key;
- const tr1::shared_ptr<const MetadataStringKey> description_key;
+ const tr1::shared_ptr<const MetadataValueKey<std::string> > description_key;
Implementation(const Environment * const e,
const QualifiedPackageName & q,
@@ -75,12 +75,12 @@ namespace paludis
repository_name(n),
build_dependencies_labels(new DependencyLabelSequence),
run_dependencies_labels(new DependencyLabelSequence),
- fs_location_key(new LiteralMetadataFSEntryKey("location", "Location", mkt_normal, l)),
+ fs_location_key(new LiteralMetadataValueKey<FSEntry> ("location", "Location", mkt_normal, l)),
build_dependencies_key(new UnpackagedDependencyKey(env, "build_dependencies", "Build dependencies", mkt_dependencies,
build_dependencies_labels, b)),
run_dependencies_key(new UnpackagedDependencyKey(env, "run_dependencies", "Run dependencies", mkt_dependencies,
run_dependencies_labels, r)),
- description_key(new LiteralMetadataStringKey("description", "Description", mkt_significant, d))
+ description_key(new LiteralMetadataValueKey<std::string> ("description", "Description", mkt_significant, d))
{
build_dependencies_labels->push_back(make_shared_ptr(new DependencyBuildLabel("build_dependencies")));
run_dependencies_labels->push_back(make_shared_ptr(new DependencyRunLabel("run_dependencies")));
@@ -161,10 +161,10 @@ UnpackagedID::repository() const
return _imp->env->package_database()->fetch_repository(_imp->repository_name);
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
UnpackagedID::virtual_for_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> >
@@ -191,10 +191,10 @@ UnpackagedID::contains_key() const
return tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> >();
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
UnpackagedID::contained_in_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> >
@@ -233,22 +233,22 @@ UnpackagedID::homepage_key() const
return tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
UnpackagedID::short_description_key() const
{
return _imp->description_key;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
UnpackagedID::long_description_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataContentsKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >
UnpackagedID::contents_key() const
{
- return tr1::shared_ptr<const MetadataContentsKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >();
}
const tr1::shared_ptr<const MetadataTimeKey>
@@ -257,34 +257,34 @@ UnpackagedID::installed_time_key() const
return tr1::shared_ptr<const MetadataTimeKey>();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
UnpackagedID::source_origin_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
UnpackagedID::binary_origin_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
UnpackagedID::fs_location_key() const
{
return _imp->fs_location_key;
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
UnpackagedID::size_of_download_required_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
UnpackagedID::size_of_all_distfiles_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
bool
diff --git a/paludis/repositories/unpackaged/unpackaged_id.hh b/paludis/repositories/unpackaged/unpackaged_id.hh
index a028d3a..3c2ab4e 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.hh
+++ b/paludis/repositories/unpackaged/unpackaged_id.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -55,27 +55,27 @@ namespace paludis
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > keywords_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagSet> > iuse_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > contained_in_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > run_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > post_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > fetches_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> short_description_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> long_description_key() const;
- virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > contents_key() const;
virtual const tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_download_required_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index 5c33119..d1331e3 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -45,13 +45,13 @@ namespace paludis
tr1::shared_ptr<QualifiedPackageNameSet> package_names;
tr1::shared_ptr<CategoryNamePartSet> category_names;
- tr1::shared_ptr<const MetadataFSEntryKey> location_key;
- tr1::shared_ptr<const MetadataStringKey> name_key;
- tr1::shared_ptr<const MetadataStringKey> slot_key;
- tr1::shared_ptr<const MetadataStringKey> format_key;
- tr1::shared_ptr<const MetadataStringKey> build_dependencies_key;
- tr1::shared_ptr<const MetadataStringKey> run_dependencies_key;
- tr1::shared_ptr<const MetadataStringKey> description_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > name_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > slot_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > build_dependencies_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > run_dependencies_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > description_key;
Implementation(const RepositoryName & n,
const UnpackagedRepositoryParams & p) :
@@ -61,19 +61,19 @@ namespace paludis
ids(new PackageIDSequence),
package_names(new QualifiedPackageNameSet),
category_names(new CategoryNamePartSet),
- location_key(new LiteralMetadataFSEntryKey("location", "location",
+ location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
mkt_significant, params.location)),
- name_key(new LiteralMetadataStringKey("name", "name",
+ name_key(new LiteralMetadataValueKey<std::string> ("name", "name",
mkt_normal, stringify(params.name))),
- slot_key(new LiteralMetadataStringKey("slot", "slot",
+ slot_key(new LiteralMetadataValueKey<std::string> ("slot", "slot",
mkt_normal, stringify(params.slot))),
- format_key(new LiteralMetadataStringKey(
+ format_key(new LiteralMetadataValueKey<std::string> (
"format", "format", mkt_significant, "unpackaged")),
- build_dependencies_key(new LiteralMetadataStringKey(
+ build_dependencies_key(new LiteralMetadataValueKey<std::string> (
"build_dependencies", "build_dependencies", mkt_normal, params.build_dependencies)),
- run_dependencies_key(new LiteralMetadataStringKey(
+ run_dependencies_key(new LiteralMetadataValueKey<std::string> (
"run_dependencies", "run_dependencies", mkt_normal, params.run_dependencies)),
- description_key(new LiteralMetadataStringKey(
+ description_key(new LiteralMetadataValueKey<std::string> (
"description", "description", mkt_normal, params.description))
{
ids->push_back(id);
@@ -182,15 +182,15 @@ UnpackagedRepository::need_keys_added() const
{
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
UnpackagedRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
UnpackagedRepository::installed_root_key() const
{
- return tr1::shared_ptr<const MetadataFSEntryKey>();
+ return tr1::shared_ptr<const MetadataValueKey<FSEntry> >();
}
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.hh b/paludis/repositories/unpackaged/unpackaged_repository.hh
index e1ebd6e..5761abc 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.hh
+++ b/paludis/repositories/unpackaged/unpackaged_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -77,8 +77,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
}
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 1f76d09..e3625df 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 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
@@ -55,17 +55,17 @@ namespace paludis
mutable IDMap ids;
mutable bool has_ids;
- tr1::shared_ptr<const MetadataFSEntryKey> root_key;
- tr1::shared_ptr<const MetadataStringKey> format_key;
+ tr1::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
Implementation(const Environment * const e, const FSEntry & r, tr1::shared_ptr<Mutex> m = make_shared_ptr(new Mutex)) :
env(e),
root(r),
ids_mutex(m),
has_ids(false),
- root_key(new LiteralMetadataFSEntryKey(
+ root_key(new LiteralMetadataValueKey<FSEntry> (
"root", "root", mkt_normal, root)),
- format_key(new LiteralMetadataStringKey(
+ format_key(new LiteralMetadataValueKey<std::string> (
"format", "format", mkt_significant, "installed_virtuals"))
{
}
@@ -325,13 +325,13 @@ InstalledVirtualsRepository::unimportant_category_names() const
return result;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
InstalledVirtualsRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
InstalledVirtualsRepository::installed_root_key() const
{
return _imp->root_key;
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index 8ab949b..a570a0a 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 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
@@ -98,8 +98,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
}
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index 27c5a51..33e5ebc 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -147,7 +147,7 @@ namespace paludis
const VersionSpec version;
tr1::shared_ptr<DependencyLabelSequence> bdep_labels;
tr1::shared_ptr<DependencyLabelSequence> rdep_labels;
- const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for;
+ const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for;
const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > bdep;
const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > rdep;
mutable bool has_masks;
@@ -165,7 +165,7 @@ namespace paludis
version(p->version()),
bdep_labels(new DependencyLabelSequence),
rdep_labels(new DependencyLabelSequence),
- virtual_for(new LiteralMetadataPackageIDKey("VIRTUAL_FOR", "Virtual for", mkt_normal, p)),
+ virtual_for(new LiteralMetadataValueKey<tr1::shared_ptr<const PackageID> > ("VIRTUAL_FOR", "Virtual for", mkt_normal, p)),
bdep(new virtuals::VirtualsDepKey(e, "DEPEND", "Build dependencies", p, bdep_labels, b)),
rdep(new virtuals::VirtualsDepKey(e, "RDEPEND", "Run dependencies", p, rdep_labels, b)),
has_masks(false)
@@ -242,7 +242,7 @@ VirtualsPackageID::repository() const
return _imp->repository;
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
VirtualsPackageID::virtual_for_key() const
{
return _imp->virtual_for;
@@ -290,16 +290,16 @@ VirtualsPackageID::suggested_dependencies_key() const
return tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
VirtualsPackageID::short_description_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
VirtualsPackageID::long_description_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> >
@@ -314,10 +314,10 @@ VirtualsPackageID::homepage_key() const
return tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> >();
}
-const tr1::shared_ptr<const MetadataContentsKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >
VirtualsPackageID::contents_key() const
{
- return tr1::shared_ptr<const MetadataContentsKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > >();
}
const tr1::shared_ptr<const MetadataTimeKey>
@@ -326,16 +326,16 @@ VirtualsPackageID::installed_time_key() const
return tr1::shared_ptr<const MetadataTimeKey>();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
VirtualsPackageID::source_origin_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
VirtualsPackageID::binary_origin_key() const
{
- return tr1::shared_ptr<const MetadataStringKey>();
+ return tr1::shared_ptr<const MetadataValueKey<std::string> >();
}
bool
@@ -502,27 +502,27 @@ VirtualsPackageID::contains_key() const
return tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> >();
}
-const tr1::shared_ptr<const MetadataPackageIDKey>
+const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >
VirtualsPackageID::contained_in_key() const
{
- return tr1::shared_ptr<const MetadataPackageIDKey>();
+ return tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >();
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
VirtualsPackageID::fs_location_key() const
{
- return tr1::shared_ptr<const MetadataFSEntryKey>();
+ return tr1::shared_ptr<const MetadataValueKey<FSEntry> >();
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
VirtualsPackageID::size_of_download_required_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
-const tr1::shared_ptr<const MetadataSizeKey>
+const tr1::shared_ptr<const MetadataValueKey<long> >
VirtualsPackageID::size_of_all_distfiles_key() const
{
- return tr1::shared_ptr<const MetadataSizeKey>();
+ return tr1::shared_ptr<const MetadataValueKey<long> >();
}
diff --git a/paludis/repositories/virtuals/package_id.hh b/paludis/repositories/virtuals/package_id.hh
index e82afd3..e0b1781 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 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -83,7 +83,7 @@ namespace paludis
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<KeywordNameSet> > keywords_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<IUseFlagSet> > iuse_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<ProvideSpecTree> > provide_key() const;
@@ -93,17 +93,17 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > fetches_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> short_description_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> long_description_key() const;
- virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > contents_key() const;
virtual const tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const;
- virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const;
virtual const tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
- virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_download_required_key() const;
- virtual const tr1::shared_ptr<const MetadataSizeKey> size_of_all_distfiles_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_download_required_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<long> > size_of_all_distfiles_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 44bbfce..ecbba9a 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 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
@@ -61,14 +61,14 @@ namespace paludis
mutable IDMap ids;
mutable bool has_ids;
- tr1::shared_ptr<const MetadataStringKey> format_key;
+ tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
Implementation(const Environment * const e, tr1::shared_ptr<Mutex> m = make_shared_ptr(new Mutex)) :
env(e),
big_nasty_mutex(m),
has_names(false),
has_ids(false),
- format_key(new LiteralMetadataStringKey(
+ format_key(new LiteralMetadataValueKey<std::string> (
"format", "format", mkt_significant, "virtuals"))
{
}
@@ -414,16 +414,16 @@ VirtualsRepository::unimportant_category_names() const
return result;
}
-const tr1::shared_ptr<const MetadataStringKey>
+const tr1::shared_ptr<const MetadataValueKey<std::string> >
VirtualsRepository::format_key() const
{
return _imp->format_key;
}
-const tr1::shared_ptr<const MetadataFSEntryKey>
+const tr1::shared_ptr<const MetadataValueKey<FSEntry> >
VirtualsRepository::installed_root_key() const
{
- return tr1::shared_ptr<const MetadataFSEntryKey>();
+ return tr1::shared_ptr<const MetadataValueKey<FSEntry> >();
}
void
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index 9c99710..e466b91 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 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
@@ -100,8 +100,8 @@ namespace paludis
/* Keys */
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const;
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
};
}
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 5d0d8f9..d6c16ba 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -179,7 +179,7 @@ namespace paludis
* implementations should not return zero here, but clients should still
* check.
*/
- virtual const tr1::shared_ptr<const MetadataStringKey> format_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const = 0;
/**
* The installed_root_key, if non-zero, specifies that we contain installed
@@ -188,7 +188,7 @@ namespace paludis
* This key is currently used in various places to determine whether a repository is
* an 'installed' repository or not.
*/
- virtual const tr1::shared_ptr<const MetadataFSEntryKey> installed_root_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const = 0;
///\}
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index b76289d..9bc2859 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -146,13 +146,13 @@ namespace metadata_key
MetadataKeyType foo(m.type());
}
- void test_metadata_package_id_key(const MetadataPackageIDKey & m)
+ void test_metadata_package_id_key(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & m)
{
test_metadata_key(m);
m.value();
}
- void test_metadata_string_key(const MetadataStringKey & m)
+ void test_metadata_string_key(const MetadataValueKey<std::string> & m)
{
test_metadata_key(m);
m.value();
@@ -171,13 +171,13 @@ namespace metadata_key
time_t PALUDIS_ATTRIBUTE((unused)) t(m.value());
}
- void test_metadata_contents_key(const MetadataContentsKey & m)
+ void test_metadata_contents_key(const MetadataValueKey<tr1::shared_ptr<const Contents> > & m)
{
test_metadata_key(m);
m.value();
}
- void test_metadata_repository_mask_info_key(const MetadataRepositoryMaskInfoKey & m)
+ void test_metadata_repository_mask_info_key(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > & m)
{
test_metadata_key(m);
m.value();
diff --git a/python/metadata_key.cc b/python/metadata_key.cc
index fa613ae..56b91d3 100644
--- a/python/metadata_key.cc
+++ b/python/metadata_key.cc
@@ -49,19 +49,19 @@ class MetadataKeySptrToPythonVisitor :
{
}
- void visit(const MetadataPackageIDKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & k)
{
- obj = bp::object(tr1::static_pointer_cast<const MetadataPackageIDKey>(_m_ptr));
+ obj = bp::object(tr1::static_pointer_cast<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >(_m_ptr));
}
- void visit(const MetadataStringKey & k)
+ void visit(const MetadataValueKey<std::string> & k)
{
- obj = bp::object(tr1::static_pointer_cast<const MetadataStringKey>(_m_ptr));
+ obj = bp::object(tr1::static_pointer_cast<const MetadataValueKey<std::string> >(_m_ptr));
}
- void visit(const MetadataSizeKey & k)
+ void visit(const MetadataValueKey<long> & k)
{
- obj = bp::object(tr1::static_pointer_cast<const MetadataSizeKey>(_m_ptr));
+ obj = bp::object(tr1::static_pointer_cast<const MetadataValueKey<long> >(_m_ptr));
}
void visit(const MetadataTimeKey & k)
@@ -69,19 +69,19 @@ class MetadataKeySptrToPythonVisitor :
obj = bp::object(tr1::static_pointer_cast<const MetadataTimeKey>(_m_ptr));
}
- void visit(const MetadataContentsKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > & k)
{
- obj = bp::object(tr1::static_pointer_cast<const MetadataContentsKey>(_m_ptr));
+ obj = bp::object(tr1::static_pointer_cast<const MetadataValueKey<tr1::shared_ptr<const Contents> > >(_m_ptr));
}
- void visit(const MetadataRepositoryMaskInfoKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > & k)
{
- obj = bp::object(tr1::static_pointer_cast<const MetadataRepositoryMaskInfoKey>(_m_ptr));
+ obj = bp::object(tr1::static_pointer_cast<const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > >(_m_ptr));
}
- void visit(const MetadataFSEntryKey & k)
+ void visit(const MetadataValueKey<FSEntry> & k)
{
- obj = bp::object(tr1::static_pointer_cast<const MetadataFSEntryKey>(_m_ptr));
+ obj = bp::object(tr1::static_pointer_cast<const MetadataValueKey<FSEntry> >(_m_ptr));
}
void visit(const MetadataCollectionKey<KeywordNameSet> & k)
@@ -167,11 +167,11 @@ struct MetadataKeySptrToPython
};
struct MetadataPackageIDKeyWrapper :
- MetadataPackageIDKey,
- bp::wrapper<MetadataPackageIDKey>
+ MetadataValueKey<tr1::shared_ptr<const PackageID> > ,
+ bp::wrapper<MetadataValueKey<tr1::shared_ptr<const PackageID> > >
{
MetadataPackageIDKeyWrapper(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataPackageIDKey(r, h, t)
+ MetadataValueKey<tr1::shared_ptr<const PackageID> > (r, h, t)
{
}
@@ -185,14 +185,24 @@ struct MetadataPackageIDKeyWrapper :
else
throw PythonMethodNotImplemented("MetadataPackageIDKey", "value");
}
+
+ virtual std::string pretty_print(const Formatter<PackageID> &) const
+ {
+ Lock l(get_mutex());
+
+ if (bp::override f = get_override("pretty_print"))
+ return f();
+ else
+ throw PythonMethodNotImplemented("MetadataPackageIDKey", "pretty_print");
+ }
};
struct MetadataStringKeyWrapper :
- MetadataStringKey,
- bp::wrapper<MetadataStringKey>
+ MetadataValueKey<std::string> ,
+ bp::wrapper<MetadataValueKey<std::string> >
{
MetadataStringKeyWrapper(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataStringKey(r, h, t)
+ MetadataValueKey<std::string> (r, h, t)
{
}
@@ -237,7 +247,7 @@ struct MetadataSectionKeyWrapper :
throw PythonMethodNotImplemented("MetadataSectionKey", "need_keys_added");
}
- virtual const tr1::shared_ptr<const MetadataStringKey> title_key() const
+ virtual const tr1::shared_ptr<const MetadataValueKey<std::string> > title_key() const
{
Lock l(get_mutex());
@@ -270,11 +280,11 @@ struct MetadataTimeKeyWrapper :
};
struct MetadataContentsKeyWrapper :
- MetadataContentsKey,
- bp::wrapper<MetadataContentsKey>
+ MetadataValueKey<tr1::shared_ptr<const Contents> > ,
+ bp::wrapper<MetadataValueKey<tr1::shared_ptr<const Contents> > >
{
MetadataContentsKeyWrapper(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataContentsKey(r, h, t)
+ MetadataValueKey<tr1::shared_ptr<const Contents> > (r, h, t)
{
}
@@ -291,11 +301,11 @@ struct MetadataContentsKeyWrapper :
};
struct MetadataFSEntryKeyWrapper :
- MetadataFSEntryKey,
- bp::wrapper<MetadataFSEntryKey>
+ MetadataValueKey<FSEntry> ,
+ bp::wrapper<MetadataValueKey<FSEntry> >
{
MetadataFSEntryKeyWrapper(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataFSEntryKey(r, h, t)
+ MetadataValueKey<FSEntry> (r, h, t)
{
}
@@ -307,16 +317,16 @@ struct MetadataFSEntryKeyWrapper :
if (bp::override f = get_override("value"))
return f();
else
- throw PythonMethodNotImplemented("MetadataFSEntryKey", "value");
+ throw PythonMethodNotImplemented("MetadataValueKey<FSEntry> ", "value");
}
};
struct MetadataRepositoryMaskInfoKeyWrapper :
- MetadataRepositoryMaskInfoKey,
- bp::wrapper<MetadataRepositoryMaskInfoKey>
+ MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > ,
+ bp::wrapper<MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > >
{
MetadataRepositoryMaskInfoKeyWrapper(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataRepositoryMaskInfoKey(r, h, t)
+ MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > (r, h, t)
{
}
@@ -842,7 +852,7 @@ void expose_metadata_key()
/**
* MetadataPackageIDKey
*/
- bp::register_ptr_to_python<tr1::shared_ptr<const MetadataPackageIDKey> >();
+ bp::register_ptr_to_python<tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const PackageID> > > >();
bp::implicitly_convertible<tr1::shared_ptr<MetadataPackageIDKeyWrapper>,
tr1::shared_ptr<MetadataKey> >();
bp::class_<MetadataPackageIDKeyWrapper, tr1::shared_ptr<MetadataPackageIDKeyWrapper>,
@@ -857,7 +867,7 @@ void expose_metadata_key()
"__init__(raw_name, human_name, MetadataKeyType)"
)
)
- .def("value", bp::pure_virtual(&MetadataPackageIDKey::value),
+ .def("value", bp::pure_virtual(&MetadataValueKey<tr1::shared_ptr<const PackageID> > ::value),
"value() -> PackageID\n"
"Fetch our value."
)
@@ -866,7 +876,7 @@ void expose_metadata_key()
/**
* MetadataStringKey
*/
- bp::register_ptr_to_python<tr1::shared_ptr<const MetadataStringKey> >();
+ bp::register_ptr_to_python<tr1::shared_ptr<const MetadataValueKey<std::string> > >();
bp::implicitly_convertible<tr1::shared_ptr<MetadataStringKeyWrapper>,
tr1::shared_ptr<MetadataKey> >();
bp::class_<MetadataStringKeyWrapper, tr1::shared_ptr<MetadataStringKeyWrapper>,
@@ -881,7 +891,7 @@ void expose_metadata_key()
"__init__(raw_name, human_name, MetadataKeyType)"
)
)
- .def("value", bp::pure_virtual(&MetadataStringKey::value),
+ .def("value", bp::pure_virtual(&MetadataValueKey<std::string> ::value),
"value() -> string\n"
"Fetch our value."
)
@@ -942,7 +952,7 @@ void expose_metadata_key()
/**
* MetadataFSEntryKey
*/
- bp::register_ptr_to_python<tr1::shared_ptr<const MetadataFSEntryKey> >();
+ bp::register_ptr_to_python<tr1::shared_ptr<const MetadataValueKey<FSEntry> > >();
bp::implicitly_convertible<tr1::shared_ptr<MetadataFSEntryKeyWrapper>,
tr1::shared_ptr<MetadataKey> >();
bp::class_<MetadataFSEntryKeyWrapper, tr1::shared_ptr<MetadataFSEntryKeyWrapper>,
@@ -956,7 +966,7 @@ void expose_metadata_key()
"__init__(raw_name, human_name, MetadataKeyType)"
)
)
- .def("value", bp::pure_virtual(&MetadataFSEntryKey::value),
+ .def("value", bp::pure_virtual(&MetadataValueKey<FSEntry> ::value),
"value() -> FSEntry\n"
"Fetch our value."
)
@@ -965,7 +975,7 @@ void expose_metadata_key()
/**
* MetadataContentsKey
*/
- bp::register_ptr_to_python<tr1::shared_ptr<const MetadataContentsKey> >();
+ bp::register_ptr_to_python<tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > >();
bp::implicitly_convertible<tr1::shared_ptr<MetadataContentsKeyWrapper>,
tr1::shared_ptr<MetadataKey> >();
bp::class_<MetadataContentsKeyWrapper, tr1::shared_ptr<MetadataContentsKeyWrapper>,
@@ -979,7 +989,7 @@ void expose_metadata_key()
"__init__(raw_name, human_name, MetadataKeyType)"
)
)
- .def("value", bp::pure_virtual(&MetadataContentsKey::value),
+ .def("value", bp::pure_virtual(&MetadataValueKey<tr1::shared_ptr<const Contents> > ::value),
"value() -> Contents\n"
"Fetch our value."
)
@@ -1006,7 +1016,7 @@ void expose_metadata_key()
/**
* MetadataRepositoryMaskInfoKey
*/
- bp::register_ptr_to_python<tr1::shared_ptr<const MetadataRepositoryMaskInfoKey> >();
+ bp::register_ptr_to_python<tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > > >();
bp::implicitly_convertible<tr1::shared_ptr<MetadataRepositoryMaskInfoKeyWrapper>,
tr1::shared_ptr<MetadataKey> >();
bp::class_<MetadataRepositoryMaskInfoKeyWrapper, tr1::shared_ptr<MetadataRepositoryMaskInfoKeyWrapper>,
@@ -1021,7 +1031,7 @@ void expose_metadata_key()
"__init__(raw_name, human_name, MetadataKeyType)"
)
)
- .def("value", bp::pure_virtual(&MetadataRepositoryMaskInfoKey::value),
+ .def("value", bp::pure_virtual(&MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > ::value),
"value() -> RepositoryMaskInfo\n"
"Fetch our value."
)
diff --git a/ruby/metadata_key.cc b/ruby/metadata_key.cc
index 871b66c..bbb5dd8 100644
--- a/ruby/metadata_key.cc
+++ b/ruby/metadata_key.cc
@@ -105,19 +105,19 @@ namespace
{
}
- void visit(const MetadataPackageIDKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > &)
{
value = Data_Wrap_Struct(c_metadata_package_id_key, 0, &Common<tr1::shared_ptr<const MetadataKey> >::free,
new tr1::shared_ptr<const MetadataKey>(mm));
}
- void visit(const MetadataStringKey &)
+ void visit(const MetadataValueKey<std::string> &)
{
value = Data_Wrap_Struct(c_metadata_string_key, 0, &Common<tr1::shared_ptr<const MetadataKey> >::free,
new tr1::shared_ptr<const MetadataKey>(mm));
}
- void visit(const MetadataSizeKey &)
+ void visit(const MetadataValueKey<long> &)
{
value = Data_Wrap_Struct(c_metadata_size_key, 0, &Common<tr1::shared_ptr<const MetadataKey> >::free,
new tr1::shared_ptr<const MetadataKey>(mm));
@@ -129,13 +129,13 @@ namespace
new tr1::shared_ptr<const MetadataKey>(mm));
}
- void visit(const MetadataContentsKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > &)
{
value = Data_Wrap_Struct(c_metadata_contents_key, 0, &Common<tr1::shared_ptr<const MetadataKey> >::free,
new tr1::shared_ptr<const MetadataKey>(mm));
}
- void visit(const MetadataFSEntryKey &)
+ void visit(const MetadataValueKey<FSEntry> &)
{
value = Data_Wrap_Struct(c_metadata_fsentry_key, 0, &Common<tr1::shared_ptr<const MetadataKey> >::free,
new tr1::shared_ptr<const MetadataKey>(mm));
@@ -147,7 +147,7 @@ namespace
new tr1::shared_ptr<const MetadataKey>(mm));
}
- void visit(const MetadataRepositoryMaskInfoKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > &)
{
value = Data_Wrap_Struct(c_metadata_repository_mask_info_key, 0, &Common<tr1::shared_ptr<const MetadataKey> >::free,
new tr1::shared_ptr<const MetadataKey>(mm));
@@ -253,7 +253,7 @@ namespace
{
tr1::shared_ptr<const MetadataKey> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<const MetadataKey>, self_ptr);
- return package_id_to_value((tr1::static_pointer_cast<const MetadataPackageIDKey>(*self_ptr))->value());
+ return package_id_to_value((tr1::static_pointer_cast<const MetadataValueKey<tr1::shared_ptr<const PackageID> > >(*self_ptr))->value());
}
catch (const std::exception & e)
{
@@ -274,7 +274,7 @@ namespace
{
tr1::shared_ptr<const MetadataKey> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<const MetadataKey>, self_ptr);
- return rb_str_new2((tr1::static_pointer_cast<const MetadataStringKey>(*self_ptr))->value().c_str());
+ return rb_str_new2((tr1::static_pointer_cast<const MetadataValueKey<std::string> >(*self_ptr))->value().c_str());
}
catch (const std::exception & e)
{
@@ -295,7 +295,7 @@ namespace
{
tr1::shared_ptr<const MetadataKey> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<const MetadataKey>, self_ptr);
- return LONG2NUM((tr1::static_pointer_cast<const MetadataSizeKey>(*self_ptr))->value());
+ return LONG2NUM((tr1::static_pointer_cast<const MetadataValueKey<long> >(*self_ptr))->value());
}
catch (const std::exception & e)
{
@@ -316,7 +316,7 @@ namespace
{
tr1::shared_ptr<const MetadataKey> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<const MetadataKey>, self_ptr);
- return rb_str_new2(stringify((tr1::static_pointer_cast<const MetadataFSEntryKey>(*self_ptr))->value()).c_str());
+ return rb_str_new2(stringify((tr1::static_pointer_cast<const MetadataValueKey<FSEntry> >(*self_ptr))->value()).c_str());
}
catch (const std::exception & e)
{
@@ -358,8 +358,8 @@ namespace
{
tr1::shared_ptr<const MetadataKey> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<const MetadataKey>, self_ptr);
- if (tr1::static_pointer_cast<const MetadataContentsKey>(*self_ptr)->value())
- return contents_to_value(tr1::static_pointer_cast<const MetadataContentsKey>(*self_ptr)->value());
+ if (tr1::static_pointer_cast<const MetadataValueKey<tr1::shared_ptr<const Contents> > >(*self_ptr)->value())
+ return contents_to_value(tr1::static_pointer_cast<const MetadataValueKey<tr1::shared_ptr<const Contents> > >(*self_ptr)->value());
return Qnil;
}
catch (const std::exception & e)
@@ -381,8 +381,8 @@ namespace
{
tr1::shared_ptr<const MetadataKey> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<const MetadataKey>, self_ptr);
- if ((tr1::static_pointer_cast<const MetadataRepositoryMaskInfoKey>(*self_ptr))->value())
- return repository_mask_info_to_value(tr1::static_pointer_cast<const MetadataRepositoryMaskInfoKey>(*self_ptr)->value());
+ if ((tr1::static_pointer_cast<const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > >(*self_ptr))->value())
+ return repository_mask_info_to_value(tr1::static_pointer_cast<const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > >(*self_ptr)->value());
return Qnil;
}
catch (const std::exception & e)
diff --git a/ruby/package_id.cc b/ruby/package_id.cc
index 102a7e0..108fa61 100644
--- a/ruby/package_id.cc
+++ b/ruby/package_id.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2007, 2008 Richard Brown
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -433,7 +433,7 @@ namespace
rb_define_method(c_package_id, "invalidate_masks", RUBY_FUNC_CAST(&package_id_invalidate_masks), 0);
rb_define_method(c_package_id, "breaks_portage?", RUBY_FUNC_CAST((&PackageIDBool<&PackageID::breaks_portage>::fetch)), 0);
- rb_define_method(c_package_id, "virtual_for_key", RUBY_FUNC_CAST((&KeyValue<MetadataPackageIDKey, &PackageID::virtual_for_key>::fetch)), 0);
+ rb_define_method(c_package_id, "virtual_for_key", RUBY_FUNC_CAST((&KeyValue<MetadataValueKey<tr1::shared_ptr<const PackageID> > , &PackageID::virtual_for_key>::fetch)), 0);
rb_define_method(c_package_id, "keywords_key", RUBY_FUNC_CAST((&KeyValue<MetadataCollectionKey<KeywordNameSet>,&PackageID::keywords_key>::fetch)), 0);
rb_define_method(c_package_id, "iuse_key", RUBY_FUNC_CAST((&KeyValue<MetadataCollectionKey<IUseFlagSet>,&PackageID::iuse_key>::fetch)), 0);
rb_define_method(c_package_id, "provide_key", RUBY_FUNC_CAST((
@@ -448,14 +448,19 @@ namespace
&KeyValue<MetadataSpecTreeKey<DependencySpecTree>, &PackageID::suggested_dependencies_key>::fetch)), 0);
rb_define_method(c_package_id, "homepage_key", RUBY_FUNC_CAST((
&KeyValue<MetadataSpecTreeKey<SimpleURISpecTree>, &PackageID::homepage_key>::fetch)), 0);
- rb_define_method(c_package_id, "short_description_key", RUBY_FUNC_CAST((&KeyValue<MetadataStringKey,&PackageID::short_description_key>::fetch)), 0);
- rb_define_method(c_package_id, "long_description_key", RUBY_FUNC_CAST((&KeyValue<MetadataStringKey,&PackageID::long_description_key>::fetch)), 0);
- rb_define_method(c_package_id, "contents_key", RUBY_FUNC_CAST((&KeyValue<MetadataContentsKey,&PackageID::contents_key>::fetch)), 0);
+ rb_define_method(c_package_id, "short_description_key", RUBY_FUNC_CAST((&KeyValue<MetadataValueKey<std::string>,
+ &PackageID::short_description_key>::fetch)), 0);
+ rb_define_method(c_package_id, "long_description_key", RUBY_FUNC_CAST((&KeyValue<MetadataValueKey<std::string>,
+ &PackageID::long_description_key>::fetch)), 0);
+ rb_define_method(c_package_id, "contents_key", RUBY_FUNC_CAST((&KeyValue<MetadataValueKey<tr1::shared_ptr<const Contents> >,
+ &PackageID::contents_key>::fetch)), 0);
rb_define_method(c_package_id, "installed_time_key", RUBY_FUNC_CAST((&KeyValue<MetadataTimeKey,&PackageID::installed_time_key>::fetch)), 0);
- rb_define_method(c_package_id, "source_origin_key", RUBY_FUNC_CAST((&KeyValue<MetadataStringKey,&PackageID::source_origin_key>::fetch)), 0);
- rb_define_method(c_package_id, "binary_origin_key", RUBY_FUNC_CAST((&KeyValue<MetadataStringKey,&PackageID::binary_origin_key>::fetch)), 0);
+ rb_define_method(c_package_id, "source_origin_key", RUBY_FUNC_CAST((&KeyValue<MetadataValueKey<std::string>,
+ &PackageID::source_origin_key>::fetch)), 0);
+ rb_define_method(c_package_id, "binary_origin_key", RUBY_FUNC_CAST((&KeyValue<MetadataValueKey<std::string>,
+ &PackageID::binary_origin_key>::fetch)), 0);
rb_define_method(c_package_id, "fs_location_key", RUBY_FUNC_CAST((
- &KeyValue<MetadataFSEntryKey, &PackageID::fs_location_key>::fetch)), 0);
+ &KeyValue<MetadataValueKey<FSEntry>, &PackageID::fs_location_key>::fetch)), 0);
rb_define_method(c_package_id, "fetches_key", RUBY_FUNC_CAST((
&KeyValue<MetadataSpecTreeKey<FetchableURISpecTree>, &PackageID::fetches_key>::fetch)), 0);
diff --git a/ruby/repository.cc b/ruby/repository.cc
index faf5fe9..4108480 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -963,9 +963,9 @@ namespace
rb_define_method(c_repository, "[]", RUBY_FUNC_CAST(&repository_subscript), 1);
rb_define_method(c_repository, "each_metadata", RUBY_FUNC_CAST(&repository_each_metadata), 0);
rb_define_method(c_repository, "format_key",
- RUBY_FUNC_CAST((&RepositoryKey<MetadataStringKey, &Repository::format_key>::fetch)), 0);
+ RUBY_FUNC_CAST((&RepositoryKey<MetadataValueKey<std::string> , &Repository::format_key>::fetch)), 0);
rb_define_method(c_repository, "installed_root_key",
- RUBY_FUNC_CAST((&RepositoryKey<MetadataFSEntryKey, &Repository::installed_root_key>::fetch)), 0);
+ RUBY_FUNC_CAST((&RepositoryKey<MetadataValueKey<FSEntry>, &Repository::installed_root_key>::fetch)), 0);
rb_define_method(c_repository, "get_environment_variable", RUBY_FUNC_CAST(&repository_get_environment_variable), 2);
/*
diff --git a/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc b/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc
index 003b5c7..1139e1a 100644
--- a/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc
+++ b/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc
@@ -165,17 +165,17 @@ namespace gtkpaludis
got_key(k, k.pretty_print_flat(formatter));
}
- void visit(const MetadataPackageIDKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & k)
{
got_key(k, markup_escape(stringify(*k.value())));
}
- void visit(const MetadataStringKey & k)
+ void visit(const MetadataValueKey<std::string> & k)
{
got_key(k, markup_escape(stringify(k.value())));
}
- void visit(const MetadataSizeKey & k)
+ void visit(const MetadataValueKey<long> & k)
{
got_key(k, markup_escape(stringify(k.value())));
}
@@ -190,7 +190,7 @@ namespace gtkpaludis
got_key(k, markup_escape(stringify(buf)));
}
- void visit(const MetadataRepositoryMaskInfoKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > & k)
{
if (! k.value())
return;
@@ -199,12 +199,12 @@ namespace gtkpaludis
join((*k.value())[k::comment()]->begin(), (*k.value())[k::comment()]->end(), " ")));
}
- void visit(const MetadataFSEntryKey & k)
+ void visit(const MetadataValueKey<FSEntry> & k)
{
got_key(k, markup_escape(stringify(k.value())));
}
- void visit(const MetadataContentsKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > &)
{
}
diff --git a/src/clients/inquisitio/key_extractor.cc b/src/clients/inquisitio/key_extractor.cc
index 0f59345..1fbb7fd 100644
--- a/src/clients/inquisitio/key_extractor.cc
+++ b/src/clients/inquisitio/key_extractor.cc
@@ -197,12 +197,12 @@ namespace
{
}
- void visit(const MetadataStringKey & s)
+ void visit(const MetadataValueKey<std::string> & s)
{
result = _m(s.value());
}
- void visit(const MetadataSizeKey & s)
+ void visit(const MetadataValueKey<long> & s)
{
result = _m(stringify(s.value()));
}
@@ -212,20 +212,20 @@ namespace
result = _m(stringify(s.value()));
}
- void visit(const MetadataContentsKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > &)
{
}
- void visit(const MetadataRepositoryMaskInfoKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > &)
{
}
- void visit(const MetadataFSEntryKey & s)
+ void visit(const MetadataValueKey<FSEntry> & s)
{
result = _m(stringify(s.value()));
}
- void visit(const MetadataPackageIDKey & s)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & s)
{
result = _m(stringify(*s.value()));
}
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index 4bb924a..19c796b 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -51,17 +51,17 @@ namespace
struct KeyValidator :
ConstVisitor<MetadataKeyVisitorTypes>
{
- void visit(const MetadataStringKey & k)
+ void visit(const MetadataValueKey<std::string> & k)
{
const std::string & PALUDIS_ATTRIBUTE((unused)) s(k.value());
}
- void visit(const MetadataSizeKey & k)
+ void visit(const MetadataValueKey<long> & k)
{
long PALUDIS_ATTRIBUTE((unused)) t(k.value());
}
- void visit(const MetadataPackageIDKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & k)
{
const tr1::shared_ptr<const PackageID> & PALUDIS_ATTRIBUTE((unused)) p(k.value());
}
@@ -71,17 +71,17 @@ namespace
time_t PALUDIS_ATTRIBUTE((unused)) t(k.value());
}
- void visit(const MetadataContentsKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > & k)
{
const tr1::shared_ptr<const Contents> & PALUDIS_ATTRIBUTE((unused)) c(k.value());
}
- void visit(const MetadataFSEntryKey & k)
+ void visit(const MetadataValueKey<FSEntry> & k)
{
const FSEntry & PALUDIS_ATTRIBUTE((unused)) c(k.value());
}
- void visit(const MetadataRepositoryMaskInfoKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > & k)
{
const tr1::shared_ptr<const RepositoryMaskInfo> & PALUDIS_ATTRIBUTE((unused)) i(k.value());
}
@@ -254,13 +254,13 @@ main(int argc, char *argv[])
continue;
}
- if (! visitor_cast<const MetadataStringKey>(**eapi_i))
+ if (! visitor_cast<const MetadataValueKey<std::string> >(**eapi_i))
{
results.insert(std::make_pair(*i, "EAPI metadata key is not a string key"));
continue;
}
- if (visitor_cast<const MetadataStringKey>(**eapi_i)->value() == "UNKNOWN")
+ if (visitor_cast<const MetadataValueKey<std::string> >(**eapi_i)->value() == "UNKNOWN")
{
results.insert(std::make_pair(*i, "EAPI is 'UNKNOWN'"));
continue;
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index f439113..05b57b6 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 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
@@ -52,22 +52,22 @@ namespace
{
}
- void visit(const MetadataStringKey & k)
+ void visit(const MetadataValueKey<std::string> & k)
{
std::cout << k.value() << std::endl;
}
- void visit(const MetadataSizeKey & k)
+ void visit(const MetadataValueKey<long> & k)
{
std::cout << k.value() << std::endl;
}
- void visit(const MetadataFSEntryKey & k)
+ void visit(const MetadataValueKey<FSEntry> & k)
{
std::cout << k.value() << std::endl;
}
- void visit(const MetadataRepositoryMaskInfoKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > &)
{
std::cout << "(unprintable)" << std::endl;
return_code |= 1;
@@ -79,7 +79,7 @@ namespace
return_code |= 1;
}
- void visit(const MetadataContentsKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > &)
{
std::cout << "(unprintable)" << std::endl;
return_code |= 1;
@@ -157,7 +157,7 @@ namespace
std::cout << k.pretty_print_flat(f) << std::endl;
}
- void visit(const MetadataPackageIDKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & k)
{
std::cout << *k.value() << std::endl;
}
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index 7bc2696..a210054 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -77,32 +77,32 @@ namespace
std::for_each(indirect_iterator(keys.begin()), indirect_iterator(keys.end()), accept_visitor(i));
}
- void visit(const MetadataStringKey & k)
+ void visit(const MetadataValueKey<std::string> & k)
{
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << k.value() << endl;
}
- void visit(const MetadataSizeKey & k)
+ void visit(const MetadataValueKey<long> & k)
{
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << k.value() << endl;
}
- void visit(const MetadataFSEntryKey & k)
+ void visit(const MetadataValueKey<FSEntry> & k)
{
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << k.value() << endl;
}
- void visit(const MetadataPackageIDKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & k)
{
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << *k.value() << endl;
}
- void visit(const MetadataRepositoryMaskInfoKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > & k)
{
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << endl;
}
- void visit(const MetadataContentsKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > & k)
{
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << endl;
}
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index 81f6731..416fefa 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -141,17 +141,17 @@ namespace
<< join(indirect_iterator(k.value()->begin()), indirect_iterator(k.value()->end()), " ") << "\n";
}
- void visit(const MetadataPackageIDKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & k)
{
stream << k.raw_name() << ": " << stringify(*k.value()) << "\n";
}
- void visit(const MetadataStringKey & k)
+ void visit(const MetadataValueKey<std::string> & k)
{
stream << k.raw_name() << ": " << k.value() << "\n";
}
- void visit(const MetadataSizeKey & k)
+ void visit(const MetadataValueKey<long> & k)
{
stream << k.raw_name() << ": " << k.value() << "\n";
}
@@ -161,12 +161,12 @@ namespace
stream << k.raw_name() << ": " << k.value() << "\n";
}
- void visit(const MetadataFSEntryKey & k)
+ void visit(const MetadataValueKey<FSEntry> & k)
{
stream << k.raw_name() << ": " << k.value() << "\n";
}
- void visit(const MetadataRepositoryMaskInfoKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > & k)
{
if (k.value())
stream << k.raw_name() << ": " << (*k.value())[k::mask_file()] << ": "
@@ -175,7 +175,7 @@ namespace
stream << k.raw_name() << "\n";
}
- void visit(const MetadataContentsKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > & k)
{
stream << k.raw_name() << "\n";
}
diff --git a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
index d412375..1afe569 100644
--- a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
@@ -327,7 +327,7 @@ Implementation<BrokenLinkageFinder>::gather_package(const tr1::shared_ptr<const
Context ctx("When gathering the contents of " + stringify(*pkg) + ":");
- tr1::shared_ptr<const MetadataContentsKey> key(pkg->contents_key());
+ tr1::shared_ptr<const MetadataValueKey<tr1::shared_ptr<const Contents> > > key(pkg->contents_key());
if (! key)
return;
tr1::shared_ptr<const Contents> contents(key->value());
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 688e16d..35b3bd9 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -486,7 +486,7 @@ namespace
}
}
- void visit(const MetadataPackageIDKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & k)
{
if (k.type() == type)
{
@@ -503,7 +503,7 @@ namespace
}
}
- void visit(const MetadataStringKey & k)
+ void visit(const MetadataValueKey<std::string> & k)
{
if (k.type() == type)
{
@@ -520,7 +520,7 @@ namespace
}
}
- void visit(const MetadataSizeKey & k)
+ void visit(const MetadataValueKey<long> & k)
{
if (k.type() == type)
{
@@ -583,7 +583,7 @@ namespace
}
}
- void visit(const MetadataRepositoryMaskInfoKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > & k)
{
if (k.type() == type && k.value())
{
@@ -607,7 +607,7 @@ namespace
}
}
- void visit(const MetadataFSEntryKey & k)
+ void visit(const MetadataValueKey<FSEntry> & k)
{
if (k.type() == type)
{
@@ -624,7 +624,7 @@ namespace
}
}
- void visit(const MetadataContentsKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > &)
{
}
};
diff --git a/src/output/mask_displayer.cc b/src/output/mask_displayer.cc
index 13fa6f4..6d7f67d 100644
--- a/src/output/mask_displayer.cc
+++ b/src/output/mask_displayer.cc
@@ -60,17 +60,17 @@ namespace
{
std::ostringstream s;
- void visit(const MetadataPackageIDKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const PackageID> > & k)
{
s << *k.value();
}
- void visit(const MetadataStringKey & k)
+ void visit(const MetadataValueKey<std::string> & k)
{
s << k.value();
}
- void visit(const MetadataSizeKey & k)
+ void visit(const MetadataValueKey<long> & k)
{
s << k.value();
}
@@ -105,17 +105,17 @@ namespace
s << stringify(buf);
}
- void visit(const MetadataContentsKey &)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const Contents> > &)
{
}
- void visit(const MetadataRepositoryMaskInfoKey & k)
+ void visit(const MetadataValueKey<tr1::shared_ptr<const RepositoryMaskInfo> > & k)
{
s << (*k.value())[k::mask_file()] << ": " <<
join((*k.value())[k::comment()]->begin(), (*k.value())[k::comment()]->end(), " ");
}
- void visit(const MetadataFSEntryKey & k)
+ void visit(const MetadataValueKey<FSEntry> & k)
{
s << k.value();
}