aboutsummaryrefslogtreecommitdiff
path: root/doc/api/cplusplus/examples/example_contents.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-12 14:28:03 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-12 14:45:22 +0100
commit120c58323950219e16d8fe22693af221d2887f9b (patch)
tree2df48534abea1af807750dbbd0ce3ac9922bd44b /doc/api/cplusplus/examples/example_contents.cc
parent271074eb112e276d5ba25f91785431911ee3443f (diff)
downloadpaludis-120c58323950219e16d8fe22693af221d2887f9b.tar.gz
paludis-120c58323950219e16d8fe22693af221d2887f9b.tar.xz
MetadataKey value -> parse_value
Diffstat (limited to 'doc/api/cplusplus/examples/example_contents.cc')
-rw-r--r--doc/api/cplusplus/examples/example_contents.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/doc/api/cplusplus/examples/example_contents.cc b/doc/api/cplusplus/examples/example_contents.cc
index 8be11c197..8631987c2 100644
--- a/doc/api/cplusplus/examples/example_contents.cc
+++ b/doc/api/cplusplus/examples/example_contents.cc
@@ -35,23 +35,23 @@ namespace
public:
void visit(const ContentsFileEntry & d)
{
- cout << left << setw(10) << "file" << d.location_key()->value() << endl;
+ cout << left << setw(10) << "file" << d.location_key()->parse_value() << endl;
}
void visit(const ContentsDirEntry & d)
{
- cout << left << setw(10) << "dir" << d.location_key()->value() << endl;
+ cout << left << setw(10) << "dir" << d.location_key()->parse_value() << endl;
}
void visit(const ContentsSymEntry & d)
{
- cout << left << setw(10) << "sym" << d.location_key()->value()
- << " -> " << d.target_key()->value() << endl;
+ cout << left << setw(10) << "sym" << d.location_key()->parse_value()
+ << " -> " << d.target_key()->parse_value() << endl;
}
void visit(const ContentsOtherEntry & d)
{
- cout << left << setw(10) << "other" << d.location_key()->value() << endl;
+ cout << left << setw(10) << "other" << d.location_key()->parse_value() << endl;
}
};
@@ -90,12 +90,13 @@ int main(int argc, char * argv[])
cout << "ID '" << **i << "' provides contents key:" << endl;
/* Visit the contents key's value's entries with our visitor. We use
- * indirect_iterator because value()->begin() and ->end() return
+ * indirect_iterator because choices->begin() and ->end() return
* iterators to std::shared_ptr<>s rather than raw objects. */
ContentsPrinter p;
+ auto contents((*i)->contents_key()->parse_value());
std::for_each(
- indirect_iterator((*i)->contents_key()->value()->begin()),
- indirect_iterator((*i)->contents_key()->value()->end()),
+ indirect_iterator(contents->begin()),
+ indirect_iterator(contents->end()),
accept_visitor(p));
}