aboutsummaryrefslogtreecommitdiff
path: root/src/clients/inquisitio/key_extractor.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-07 21:28:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-07 21:28:26 +0000
commite15f518956383d4dc22bee5c13939f8de247a46d (patch)
treed1760116d2e5e29a7f47c3504319d13bd3e8f48a /src/clients/inquisitio/key_extractor.cc
parent8294cd0acad913897cb79aba7d94144254fdb4f3 (diff)
downloadpaludis-e15f518956383d4dc22bee5c13939f8de247a46d.tar.gz
paludis-e15f518956383d4dc22bee5c13939f8de247a46d.tar.xz
Add Map<string, string> keys
Diffstat (limited to 'src/clients/inquisitio/key_extractor.cc')
-rw-r--r--src/clients/inquisitio/key_extractor.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/clients/inquisitio/key_extractor.cc b/src/clients/inquisitio/key_extractor.cc
index 36e273867..c85019363 100644
--- a/src/clients/inquisitio/key_extractor.cc
+++ b/src/clients/inquisitio/key_extractor.cc
@@ -181,6 +181,11 @@ namespace
}
};
+ std::string stringify_string_pair(const std::pair<const std::string, std::string> & s)
+ {
+ return s.first + "=" + s.second;
+ }
+
class KeyVisitor
{
private:
@@ -298,6 +303,17 @@ namespace
std::bind(&Matcher::operator(), std::cref(_m), _1));
}
+ void visit(const MetadataCollectionKey<Map<std::string, std::string> > & s)
+ {
+ using namespace std::placeholders;
+
+ if (_flatten)
+ result = _m(join(s.value()->begin(), s.value()->end(), " ", stringify_string_pair));
+ else
+ result = s.value()->end() != std::find_if(s.value()->begin(), s.value()->end(),
+ std::bind(&Matcher::operator(), std::cref(_m), std::bind(&stringify_string_pair, _1)));
+ }
+
void visit(const MetadataCollectionKey<Sequence<std::string> > & s)
{
using namespace std::placeholders;