aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
Diffstat (limited to 'paludis')
-rw-r--r--paludis/formatter-fwd.hh9
-rw-r--r--paludis/formatter.hh29
-rw-r--r--paludis/metadata_key.cc1
-rw-r--r--paludis/metadata_key.hh4
-rw-r--r--paludis/stringify_formatter-impl.hh4
-rw-r--r--paludis/stringify_formatter.cc9
-rw-r--r--paludis/stringify_formatter.hh3
-rw-r--r--paludis/user_dep_spec.cc5
8 files changed, 59 insertions, 5 deletions
diff --git a/paludis/formatter-fwd.hh b/paludis/formatter-fwd.hh
index a9120d9bf..2554e9a8f 100644
--- a/paludis/formatter-fwd.hh
+++ b/paludis/formatter-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2010 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,7 +45,12 @@ namespace paludis
typename T12_ = NoType<12u>,
typename T13_ = NoType<13u>,
typename T14_ = NoType<14u>,
- typename T15_ = NoType<15u>
+ typename T15_ = NoType<15u>,
+ typename T16_ = NoType<16u>,
+ typename T17_ = NoType<17u>,
+ typename T18_ = NoType<18u>,
+ typename T19_ = NoType<19u>,
+ typename T20_ = NoType<20u>
>
class Formatter;
}
diff --git a/paludis/formatter.hh b/paludis/formatter.hh
index 987cbdba2..2d7d2cd28 100644
--- a/paludis/formatter.hh
+++ b/paludis/formatter.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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
@@ -901,7 +901,12 @@ namespace paludis
typename T12_,
typename T13_,
typename T14_,
- typename T15_
+ typename T15_,
+ typename T16_,
+ typename T17_,
+ typename T18_,
+ typename T19_,
+ typename T20_
>
class PALUDIS_VISIBLE Formatter :
public FormatFunctionsByProxy<T1_, typename format::CategorySelector<T1_>::Category, 1>,
@@ -919,6 +924,11 @@ namespace paludis
public FormatFunctionsByProxy<T13_, typename format::CategorySelector<T13_>::Category, 13>,
public FormatFunctionsByProxy<T14_, typename format::CategorySelector<T14_>::Category, 14>,
public FormatFunctionsByProxy<T15_, typename format::CategorySelector<T15_>::Category, 15>,
+ public FormatFunctionsByProxy<T16_, typename format::CategorySelector<T16_>::Category, 16>,
+ public FormatFunctionsByProxy<T17_, typename format::CategorySelector<T17_>::Category, 17>,
+ public FormatFunctionsByProxy<T18_, typename format::CategorySelector<T18_>::Category, 18>,
+ public FormatFunctionsByProxy<T19_, typename format::CategorySelector<T19_>::Category, 19>,
+ public FormatFunctionsByProxy<T20_, typename format::CategorySelector<T20_>::Category, 20>,
public CanSpace
{
private:
@@ -950,6 +960,11 @@ namespace paludis
FormatFunctionsByProxy<T13_, typename format::CategorySelector<T13_>::Category, 13>(&t),
FormatFunctionsByProxy<T14_, typename format::CategorySelector<T14_>::Category, 14>(&t),
FormatFunctionsByProxy<T15_, typename format::CategorySelector<T15_>::Category, 15>(&t),
+ FormatFunctionsByProxy<T16_, typename format::CategorySelector<T16_>::Category, 16>(&t),
+ FormatFunctionsByProxy<T17_, typename format::CategorySelector<T17_>::Category, 17>(&t),
+ FormatFunctionsByProxy<T18_, typename format::CategorySelector<T18_>::Category, 18>(&t),
+ FormatFunctionsByProxy<T19_, typename format::CategorySelector<T19_>::Category, 19>(&t),
+ FormatFunctionsByProxy<T20_, typename format::CategorySelector<T20_>::Category, 20>(&t),
CanSpace(),
_proxy(&t)
{
@@ -971,6 +986,11 @@ namespace paludis
FormatFunctionsByProxy<T13_, typename format::CategorySelector<T13_>::Category, 13>(other),
FormatFunctionsByProxy<T14_, typename format::CategorySelector<T14_>::Category, 14>(other),
FormatFunctionsByProxy<T15_, typename format::CategorySelector<T15_>::Category, 15>(other),
+ FormatFunctionsByProxy<T16_, typename format::CategorySelector<T16_>::Category, 16>(other),
+ FormatFunctionsByProxy<T17_, typename format::CategorySelector<T17_>::Category, 17>(other),
+ FormatFunctionsByProxy<T18_, typename format::CategorySelector<T18_>::Category, 18>(other),
+ FormatFunctionsByProxy<T19_, typename format::CategorySelector<T19_>::Category, 19>(other),
+ FormatFunctionsByProxy<T20_, typename format::CategorySelector<T20_>::Category, 20>(other),
CanSpace(other),
_proxy(other._proxy)
{
@@ -993,6 +1013,11 @@ namespace paludis
using FormatFunctionsByProxy<T13_, typename format::CategorySelector<T13_>::Category, 13>::format;
using FormatFunctionsByProxy<T14_, typename format::CategorySelector<T14_>::Category, 14>::format;
using FormatFunctionsByProxy<T15_, typename format::CategorySelector<T15_>::Category, 15>::format;
+ using FormatFunctionsByProxy<T16_, typename format::CategorySelector<T16_>::Category, 16>::format;
+ using FormatFunctionsByProxy<T17_, typename format::CategorySelector<T17_>::Category, 17>::format;
+ using FormatFunctionsByProxy<T18_, typename format::CategorySelector<T18_>::Category, 18>::format;
+ using FormatFunctionsByProxy<T19_, typename format::CategorySelector<T19_>::Category, 19>::format;
+ using FormatFunctionsByProxy<T20_, typename format::CategorySelector<T20_>::Category, 20>::format;
virtual std::string newline() const
{
diff --git a/paludis/metadata_key.cc b/paludis/metadata_key.cc
index e294ba95c..2ea3f0864 100644
--- a/paludis/metadata_key.cc
+++ b/paludis/metadata_key.cc
@@ -101,6 +101,7 @@ MetadataSpecTreeKey<DependencySpecTree>::~MetadataSpecTreeKey()
template class MetadataCollectionKey<KeywordNameSet>;
template class MetadataCollectionKey<Set<std::string> >;
template class MetadataCollectionKey<Sequence<std::string> >;
+template class MetadataCollectionKey<Map<std::string, std::string> >;
template class MetadataCollectionKey<PackageIDSequence>;
template class MetadataCollectionKey<FSPathSequence>;
diff --git a/paludis/metadata_key.hh b/paludis/metadata_key.hh
index 798b61681..102cde832 100644
--- a/paludis/metadata_key.hh
+++ b/paludis/metadata_key.hh
@@ -38,6 +38,7 @@
#include <paludis/util/type_list.hh>
#include <paludis/util/timestamp-fwd.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/map.hh>
#include <type_traits>
#include <string>
@@ -90,6 +91,7 @@ namespace paludis
MetadataCollectionKey<Sequence<std::string> >,
MetadataCollectionKey<PackageIDSequence>,
MetadataCollectionKey<FSPathSequence>,
+ MetadataCollectionKey<Map<std::string, std::string> >,
MetadataSpecTreeKey<DependencySpecTree>,
MetadataSpecTreeKey<LicenseSpecTree>,
MetadataSpecTreeKey<FetchableURISpecTree>,
@@ -277,7 +279,7 @@ namespace paludis
};
/**
- * A MetadataCollectionKey is a MetadataKey that holds a Set of some kind of item
+ * A MetadataCollectionKey is a MetadataKey that holds a container of some kind of item
* as its value.
*
* \ingroup g_metadata_key
diff --git a/paludis/stringify_formatter-impl.hh b/paludis/stringify_formatter-impl.hh
index ecdcc27f3..7983a35d1 100644
--- a/paludis/stringify_formatter-impl.hh
+++ b/paludis/stringify_formatter-impl.hh
@@ -43,6 +43,7 @@ namespace paludis
struct Imp<StringifyFormatter>
{
const CanFormat<std::string> * const f_str;
+ const CanFormat<std::pair<const std::string, std::string> > * const f_str_str;
const CanFormat<ChoiceValue> * const f_conf;
const CanFormat<KeywordName> * const f_keyword;
const CanFormat<PackageDepSpec> * const f_package;
@@ -62,6 +63,7 @@ namespace paludis
Imp(
const CanFormat<std::string> * const f_str_v,
+ const CanFormat<std::pair<const std::string, std::string> > * const f_str_str_v,
const CanFormat<ChoiceValue> * const f_conf_v,
const CanFormat<KeywordName> * const f_keyword_v,
const CanFormat<PackageDepSpec> * const f_package_v,
@@ -80,6 +82,7 @@ namespace paludis
const CanSpace * const f_space_v
) :
f_str(f_str_v),
+ f_str_str(f_str_str_v),
f_conf(f_conf_v),
f_keyword(f_keyword_v),
f_package(f_package_v),
@@ -184,6 +187,7 @@ namespace paludis
StringifyFormatter::StringifyFormatter(const T_ & t) :
Pimp<StringifyFormatter>(
StringifyFormatterGetForwarder<std::is_convertible<T_ *, CanFormat<std::string> *>::value, std::string>::get(&t),
+ StringifyFormatterGetForwarder<std::is_convertible<T_ *, CanFormat<std::pair<const std::string, std::string> > *>::value, std::pair<const std::string, std::string> >::get(&t),
StringifyFormatterGetForwarder<std::is_convertible<T_ *, CanFormat<ChoiceValue> *>::value, ChoiceValue>::get(&t),
StringifyFormatterGetForwarder<std::is_convertible<T_ *, CanFormat<KeywordName> *>::value, KeywordName>::get(&t),
StringifyFormatterGetForwarder<std::is_convertible<T_ *, CanFormat<PackageDepSpec> *>::value, PackageDepSpec>::get(&t),
diff --git a/paludis/stringify_formatter.cc b/paludis/stringify_formatter.cc
index ab6061f36..beb0fdfa9 100644
--- a/paludis/stringify_formatter.cc
+++ b/paludis/stringify_formatter.cc
@@ -30,6 +30,7 @@ using namespace paludis;
StringifyFormatter::StringifyFormatter() :
Pimp<StringifyFormatter>(
static_cast<const CanFormat<std::string> *>(0),
+ static_cast<const CanFormat<std::pair<const std::string, std::string> > *>(0),
static_cast<const CanFormat<ChoiceValue> *>(0),
static_cast<const CanFormat<KeywordName> *>(0),
static_cast<const CanFormat<PackageDepSpec> *>(0),
@@ -63,6 +64,14 @@ StringifyFormatter::format(const std::string & s, const format::Plain & k) const
}
std::string
+StringifyFormatter::format(const std::pair<const std::string, std::string> & s, const format::Plain & k) const
+{
+ if (_imp->f_str)
+ return _imp->f_str_str->format(s, k);
+ return s.first + "=" + s.second;
+}
+
+std::string
StringifyFormatter::format(const KeywordName & s, const format::Accepted & k) const
{
if (_imp->f_keyword)
diff --git a/paludis/stringify_formatter.hh b/paludis/stringify_formatter.hh
index a18c1c68c..c223516de 100644
--- a/paludis/stringify_formatter.hh
+++ b/paludis/stringify_formatter.hh
@@ -60,6 +60,7 @@ namespace paludis
class PALUDIS_VISIBLE StringifyFormatter :
private Pimp<StringifyFormatter>,
public CanFormat<std::string>,
+ public CanFormat<std::pair<const std::string, std::string> >,
public CanFormat<ChoiceValue>,
public CanFormat<KeywordName>,
public CanFormat<PackageDepSpec>,
@@ -98,6 +99,8 @@ namespace paludis
virtual std::string format(const std::string &, const format::Plain &) const;
+ virtual std::string format(const std::pair<const std::string, std::string> &, const format::Plain &) const;
+
virtual std::string format(const ChoiceValue &, const format::Enabled &) const;
virtual std::string format(const ChoiceValue &, const format::Disabled &) const;
virtual std::string format(const ChoiceValue &, const format::Forced &) const;
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index f3c72eca5..ce4b7a2f5 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -738,6 +738,11 @@ namespace
return false;
}
+ bool visit(const MetadataCollectionKey<Map<std::string, std::string> > &) const
+ {
+ return false;
+ }
+
bool visit(const MetadataCollectionKey<KeywordNameSet> & s) const
{
switch (op)