aboutsummaryrefslogtreecommitdiff
path: root/paludis/literal_metadata_key.hh
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-30 22:48:34 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-01 03:57:53 +0000
commit3dd53676acf85d7b3d9758f2def081d20c00b3b9 (patch)
tree7214265998b38ce234a4198a4c2b9533aeea5f4d /paludis/literal_metadata_key.hh
parentcdaf7c2138035625d99ee5be127f427943b66e09 (diff)
downloadpaludis-3dd53676acf85d7b3d9758f2def081d20c00b3b9.tar.gz
paludis-3dd53676acf85d7b3d9758f2def081d20c00b3b9.tar.xz
Better pretty printing mechanism
Diffstat (limited to 'paludis/literal_metadata_key.hh')
-rw-r--r--paludis/literal_metadata_key.hh28
1 files changed, 27 insertions, 1 deletions
diff --git a/paludis/literal_metadata_key.hh b/paludis/literal_metadata_key.hh
index b514e1fe4..1f49f5061 100644
--- a/paludis/literal_metadata_key.hh
+++ b/paludis/literal_metadata_key.hh
@@ -100,6 +100,16 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
};
+ template <typename T_>
+ class PALUDIS_VISIBLE PrettyPrintableLiteralMetadataValueKey :
+ public MetadataValueKey<T_>
+ {
+ public:
+ virtual const std::string pretty_print_value(
+ const PrettyPrinter &,
+ const PrettyPrintOptions &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
/**
* A LiteralMetadataValueKey is a MetadataValueKey whose value is a
* copyable literal that is known at construction time.
@@ -109,7 +119,7 @@ namespace paludis
*/
template <typename T_>
class PALUDIS_VISIBLE LiteralMetadataValueKey :
- public MetadataValueKey<T_>,
+ public std::conditional<MetadataValueKeyIsPrettyPrintable<T_>::value, PrettyPrintableLiteralMetadataValueKey<T_>, MetadataValueKey<T_> >::type,
private Pimp<LiteralMetadataValueKey<T_> >,
public ExtraLiteralMetadataValueKeyMethods<T_>
{
@@ -170,6 +180,10 @@ namespace paludis
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string pretty_print_value(
+ const PrettyPrinter &,
+ const PrettyPrintOptions &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
/**
@@ -204,6 +218,10 @@ namespace paludis
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string pretty_print_value(
+ const PrettyPrinter &,
+ const PrettyPrintOptions &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
/**
@@ -238,6 +256,10 @@ namespace paludis
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string pretty_print_value(
+ const PrettyPrinter &,
+ const PrettyPrintOptions &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
/**
@@ -303,6 +325,10 @@ namespace paludis
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string pretty_print_value(
+ const PrettyPrinter &,
+ const PrettyPrintOptions &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}