aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-14 02:28:01 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-14 02:35:42 +0100
commite16ed98136af8f399bad3d9e148aaa074d417f81 (patch)
tree4d4aa0742711bca7502e73f9f1584bb63864749f
parent11904c3bb9dcb890b699417901376101efb0084d (diff)
downloadpaludis-e16ed98136af8f399bad3d9e148aaa074d417f81.tar.gz
paludis-e16ed98136af8f399bad3d9e148aaa074d417f81.tar.xz
Use formatters properly
-rw-r--r--paludis/repositories/e/e_key.cc13
-rw-r--r--paludis/repositories/e/info_metadata_key.cc14
2 files changed, 23 insertions, 4 deletions
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 2bb03bf..1114698 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -959,10 +959,19 @@ EInheritedKey::value() const
return _imp->value;
}
+namespace
+{
+ std::string format_string(const std::string & i, const Formatter<std::string> & f)
+ {
+ return f.format(i, format::Plain());
+ }
+}
+
std::string
-EInheritedKey::pretty_print_flat(const Formatter<std::string> &) const
+EInheritedKey::pretty_print_flat(const Formatter<std::string> & f) const
{
- return join(value()->begin(), value()->end(), " ");
+ using namespace std::tr1::placeholders;
+ return join(value()->begin(), value()->end(), " ", std::tr1::bind(&format_string, _1, f));
}
namespace paludis
diff --git a/paludis/repositories/e/info_metadata_key.cc b/paludis/repositories/e/info_metadata_key.cc
index 4a1bfa1..9d9eb98 100644
--- a/paludis/repositories/e/info_metadata_key.cc
+++ b/paludis/repositories/e/info_metadata_key.cc
@@ -40,6 +40,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
+#include <paludis/formatter.hh>
#include <set>
#include <algorithm>
#include <tr1/functional>
@@ -180,10 +181,19 @@ InfoPkgsMetadataKey::need_keys_added() const
}
}
+namespace
+{
+ std::string format_string(const std::string & i, const Formatter<std::string> & f)
+ {
+ return f.format(i, format::Plain());
+ }
+}
+
std::string
-InfoVarsMetadataKey::pretty_print_flat(const Formatter<std::string> &) const
+InfoVarsMetadataKey::pretty_print_flat(const Formatter<std::string> & f) const
{
- return join(value()->begin(), value()->end(), " ");
+ using namespace std::tr1::placeholders;
+ return join(value()->begin(), value()->end(), " ", std::tr1::bind(&format_string, _1, f));
}
template class PrivateImplementationPattern<InfoPkgsMetadataKey>;