aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-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;