aboutsummaryrefslogtreecommitdiff
path: root/doc/api/cplusplus/examples/example_metadata_key.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 /doc/api/cplusplus/examples/example_metadata_key.cc
parent8294cd0acad913897cb79aba7d94144254fdb4f3 (diff)
downloadpaludis-e15f518956383d4dc22bee5c13939f8de247a46d.tar.gz
paludis-e15f518956383d4dc22bee5c13939f8de247a46d.tar.xz
Add Map<string, string> keys
Diffstat (limited to 'doc/api/cplusplus/examples/example_metadata_key.cc')
-rw-r--r--doc/api/cplusplus/examples/example_metadata_key.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/api/cplusplus/examples/example_metadata_key.cc b/doc/api/cplusplus/examples/example_metadata_key.cc
index a75944a6d..f61d5f3cf 100644
--- a/doc/api/cplusplus/examples/example_metadata_key.cc
+++ b/doc/api/cplusplus/examples/example_metadata_key.cc
@@ -32,6 +32,11 @@ namespace
{
void show_key(const MetadataKey & key, const std::string & indent = "");
+ std::string stringify_string_pair(const std::pair<const std::string, std::string> & s)
+ {
+ return s.first + "=" + s.second;
+ }
+
/* We use this visitor to display extra information about a MetadataKey,
* depending upon its type. */
class MetadataKeyInformationVisitor
@@ -187,6 +192,13 @@ namespace
cout << indent << left << setw(30) << " Value:" << " " << join(key.value()->begin(), key.value()->end(), " ") << endl;
}
+ void visit(const MetadataCollectionKey<Map<std::string, std::string> > & key)
+ {
+ cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<Map<std::string, std::string> >" << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << join(
+ key.value()->begin(), key.value()->end(), " ", stringify_string_pair) << endl;
+ }
+
void visit(const MetadataCollectionKey<Sequence<std::string> > & key)
{
cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<Sequence<std::string> >" << endl;