aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-22 00:30:01 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-22 00:30:01 +0000
commitd5aa27d7859537369060a1c042fdb478bfc3d2df (patch)
tree71242e38c0bd9a601937e3e7dd34724b71d784ad
parent6b2e0ed19cb15c15460b35f8d1d42d4fa02bc11f (diff)
downloadpaludis-d5aa27d7859537369060a1c042fdb478bfc3d2df.tar.gz
paludis-d5aa27d7859537369060a1c042fdb478bfc3d2df.tar.xz
Make literal bool keys work
-rw-r--r--paludis/literal_metadata_key.cc11
-rw-r--r--paludis/literal_metadata_key.hh21
2 files changed, 30 insertions, 2 deletions
diff --git a/paludis/literal_metadata_key.cc b/paludis/literal_metadata_key.cc
index 0df3f48..95c134b 100644
--- a/paludis/literal_metadata_key.cc
+++ b/paludis/literal_metadata_key.cc
@@ -281,6 +281,17 @@ ExtraLiteralMetadataValueKeyMethods<long>::pretty_print() const
return stringify(v);
}
+ExtraLiteralMetadataValueKeyMethods<bool>::~ExtraLiteralMetadataValueKeyMethods()
+{
+}
+
+std::string
+ExtraLiteralMetadataValueKeyMethods<bool>::pretty_print() const
+{
+ bool v(static_cast<const LiteralMetadataValueKey<bool> *>(this)->value());
+ return stringify(v);
+}
+
ExtraLiteralMetadataValueKeyMethods<std::tr1::shared_ptr<const PackageID> >::~ExtraLiteralMetadataValueKeyMethods()
{
}
diff --git a/paludis/literal_metadata_key.hh b/paludis/literal_metadata_key.hh
index af65131..070398c 100644
--- a/paludis/literal_metadata_key.hh
+++ b/paludis/literal_metadata_key.hh
@@ -57,7 +57,7 @@ namespace paludis
* \since 0.26
*/
template <>
- class ExtraLiteralMetadataValueKeyMethods<std::tr1::shared_ptr<const PackageID> > :
+ class PALUDIS_VISIBLE ExtraLiteralMetadataValueKeyMethods<std::tr1::shared_ptr<const PackageID> > :
public virtual ExtraMetadataValueKeyMethods<std::tr1::shared_ptr<const PackageID> >
{
public:
@@ -74,7 +74,7 @@ namespace paludis
* \since 0.28
*/
template <>
- class ExtraLiteralMetadataValueKeyMethods<long> :
+ class PALUDIS_VISIBLE ExtraLiteralMetadataValueKeyMethods<long> :
public virtual ExtraMetadataValueKeyMethods<long>
{
public:
@@ -85,6 +85,23 @@ namespace paludis
};
/**
+ * Implement extra methods for LiteralMetadataValueKey for bool.
+ *
+ * \ingroup g_metadata_key
+ * \since 0.34.1
+ */
+ template <>
+ class PALUDIS_VISIBLE ExtraLiteralMetadataValueKeyMethods<bool> :
+ public virtual ExtraMetadataValueKeyMethods<bool>
+ {
+ public:
+ virtual ~ExtraLiteralMetadataValueKeyMethods() = 0;
+
+ virtual std::string pretty_print() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ /**
* A LiteralMetadataValueKey is a MetadataValueKey whose value is a
* copyable literal that is known at construction time.
*