aboutsummaryrefslogtreecommitdiff
path: root/doc
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
parent271074eb112e276d5ba25f91785431911ee3443f (diff)
downloadpaludis-120c58323950219e16d8fe22693af221d2887f9b.tar.gz
paludis-120c58323950219e16d8fe22693af221d2887f9b.tar.xz
MetadataKey value -> parse_value
Diffstat (limited to 'doc')
-rw-r--r--doc/api/cplusplus/examples/example_contents.cc17
-rw-r--r--doc/api/cplusplus/examples/example_dep_label.cc2
-rw-r--r--doc/api/cplusplus/examples/example_dep_spec_flattener.cc6
-rw-r--r--doc/api/cplusplus/examples/example_metadata_key.cc32
-rw-r--r--doc/api/ruby/example_contents.rb10
-rw-r--r--doc/api/ruby/example_dep_tree.rb4
6 files changed, 38 insertions, 33 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));
}
diff --git a/doc/api/cplusplus/examples/example_dep_label.cc b/doc/api/cplusplus/examples/example_dep_label.cc
index 5514423c7..8edf02321 100644
--- a/doc/api/cplusplus/examples/example_dep_label.cc
+++ b/doc/api/cplusplus/examples/example_dep_label.cc
@@ -176,7 +176,7 @@ int main(int argc, char * argv[])
/* Create a visitor that will collect distfiles, and do the collecting. */
DistfilesCollector collector(results, is_initial_label_restricted.result);
- (*i)->fetches_key()->value()->top()->accept(collector);
+ (*i)->fetches_key()->parse_value()->top()->accept(collector);
}
/* Display summary of results */
diff --git a/doc/api/cplusplus/examples/example_dep_spec_flattener.cc b/doc/api/cplusplus/examples/example_dep_spec_flattener.cc
index ce59d074f..f50884151 100644
--- a/doc/api/cplusplus/examples/example_dep_spec_flattener.cc
+++ b/doc/api/cplusplus/examples/example_dep_spec_flattener.cc
@@ -60,7 +60,7 @@ int main(int argc, char * argv[])
DepSpecFlattener<ProvideSpecTree, PackageDepSpec> provides(env.get(), *i);
/* Populate it by making it visit the key's value */
- (*i)->provide_key()->value()->top()->accept(provides);
+ (*i)->provide_key()->parse_value()->top()->accept(provides);
/* The results are available through DepSpecFlattener::begin()
* and ::end(). These return an iterator to a std::shared_ptr<>,
@@ -74,7 +74,7 @@ int main(int argc, char * argv[])
if ((*i)->homepage_key())
{
DepSpecFlattener<SimpleURISpecTree, SimpleURIDepSpec> homepages(env.get(), *i);
- (*i)->homepage_key()->value()->top()->accept(homepages);
+ (*i)->homepage_key()->parse_value()->top()->accept(homepages);
cout << " " << left << setw(24) << "Homepages:" << " "
<< join(indirect_iterator(homepages.begin()), indirect_iterator(homepages.end()), " ")
@@ -93,7 +93,7 @@ int main(int argc, char * argv[])
DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env.get(), *i);
visitor_cast<const MetadataSpecTreeKey<PlainTextSpecTree> >(
- **(*i)->find_metadata("RESTRICT"))->value()->top()->accept(restricts);
+ **(*i)->find_metadata("RESTRICT"))->parse_value()->top()->accept(restricts);
cout << " " << left << setw(24) << "Restricts:" << " "
<< join(indirect_iterator(restricts.begin()), indirect_iterator(restricts.end()), " ")
diff --git a/doc/api/cplusplus/examples/example_metadata_key.cc b/doc/api/cplusplus/examples/example_metadata_key.cc
index 17821ba7f..db98d2c76 100644
--- a/doc/api/cplusplus/examples/example_metadata_key.cc
+++ b/doc/api/cplusplus/examples/example_metadata_key.cc
@@ -58,45 +58,45 @@ namespace
void visit(const MetadataValueKey<std::string> & key)
{
cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<std::string>" << endl;
- cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << key.parse_value() << endl;
}
void visit(const MetadataValueKey<SlotName> & key)
{
cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<SlotName>" << endl;
- cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << key.parse_value() << endl;
}
void visit(const MetadataValueKey<long> & key)
{
cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<long>" << endl;
- cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << key.parse_value() << endl;
}
void visit(const MetadataValueKey<bool> & key)
{
cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<bool>" << endl;
- cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << key.parse_value() << endl;
}
void visit(const MetadataValueKey<FSPath> & key)
{
cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<FSPath>" << endl;
- cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << key.parse_value() << endl;
}
void visit(const MetadataValueKey<std::shared_ptr<const PackageID> > & key)
{
cout << indent << left << setw(30) << " Class:" << " " <<
"MetadataValueKey<std::shared_ptr<const PackageID> >" << endl;
- cout << indent << left << setw(30) << " Value:" << " " << *key.value() << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << *key.parse_value() << endl;
}
void visit(const MetadataTimeKey & key)
{
cout << indent << left << setw(30) << " Class:" << " " << "MetadataTimeKey" << endl;
- cout << indent << left << setw(30) << " Value:" << " " << pretty_print_time(key.value().seconds()) << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << pretty_print_time(key.parse_value().seconds()) << endl;
}
void visit(const MetadataValueKey<std::shared_ptr<const Contents> > &)
@@ -167,37 +167,41 @@ namespace
void visit(const MetadataCollectionKey<Set<std::string> > & key)
{
+ auto value(key.parse_value());
cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<Set<std::string> >" << endl;
- cout << indent << left << setw(30) << " Value:" << " " << join(key.value()->begin(), key.value()->end(), " ") << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << join(value->begin(), value->end(), " ") << endl;
}
void visit(const MetadataCollectionKey<Map<std::string, std::string> > & key)
{
+ auto value(key.parse_value());
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;
+ cout << indent << left << setw(30) << " Value:" << " " << join(value->begin(), value->end(), " ", stringify_string_pair) << endl;
}
void visit(const MetadataCollectionKey<Sequence<std::string> > & key)
{
+ auto value(key.parse_value());
cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<Sequence<std::string> >" << endl;
- cout << indent << left << setw(30) << " Value:" << " " << join(key.value()->begin(), key.value()->end(), " ") << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << join(value->begin(), value->end(), " ") << endl;
}
void visit(const MetadataCollectionKey<FSPathSequence> & key)
{
+ auto value(key.parse_value());
cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<FSPathSequence>" << endl;
- cout << indent << left << setw(30) << " Value:" << " " << join(key.value()->begin(), key.value()->end(), " ") << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << join(value->begin(), value->end(), " ") << endl;
}
void visit(const MetadataCollectionKey<PackageIDSequence> & key)
{
+ auto value(key.parse_value());
cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<PackageIDSequence>" << endl;
/* Slight trickery: a PackageIDSequence stores shared pointers
* to PackageID instances, so we need indirect_iterator to get
* an extra level of dereferencing. */
- cout << indent << left << setw(30) << " Value:" << " " << join(indirect_iterator(key.value()->begin()),
- indirect_iterator(key.value()->end()), " ") << endl;
+ cout << indent << left << setw(30) << " Value:" << " " << join(indirect_iterator(value->begin()),
+ indirect_iterator(value->end()), " ") << endl;
}
void visit(const MetadataSectionKey & key)
diff --git a/doc/api/ruby/example_contents.rb b/doc/api/ruby/example_contents.rb
index d653fe57a..0d5bb0906 100644
--- a/doc/api/ruby/example_contents.rb
+++ b/doc/api/ruby/example_contents.rb
@@ -30,20 +30,20 @@ ids.each do | id |
puts "ID '#{id}' provides contents key:"
# Contents is made up of a collection of ContentsEntry instances.
- id.contents_key.value.each do | c |
+ id.contents_key.parse_value.each do | c |
# Some ContentsEntry subclasses contain more information than others
if c.kind_of? ContentsOtherEntry
- puts "other #{c.location_key.value}"
+ puts "other #{c.location_key.parse_value}"
elsif c.kind_of? ContentsFileEntry
- puts "file #{c.location_key.value}"
+ puts "file #{c.location_key.parse_value}"
elsif c.kind_of? ContentsDirEntry
- puts "dir #{c.location_key.value}"
+ puts "dir #{c.location_key.parse_value}"
elsif c.kind_of? ContentsSymEntry
- puts "sym #{c.location_key.value} -> #{c.target_key.value}"
+ puts "sym #{c.location_key.parse_value} -> #{c.target_key.parse_value}"
else
puts "unknown #{c}"
diff --git a/doc/api/ruby/example_dep_tree.rb b/doc/api/ruby/example_dep_tree.rb
index 53d3a4817..ab56fdbcd 100644
--- a/doc/api/ruby/example_dep_tree.rb
+++ b/doc/api/ruby/example_dep_tree.rb
@@ -134,13 +134,13 @@ ids.each do | id |
[ :build_dependencies_key, :run_dependencies_key, :post_dependencies_key,
:suggested_dependencies_key ].each do | key |
if id.send(key)
- collect_dependencies(env, id, id.send(key).value, results)
+ collect_dependencies(env, id, id.send(key).parse_value, results)
end
end
# And the same for '.zip' file extensions
if id.fetches_key
- collect_extensions(env, id, id.fetches_key.value, results)
+ collect_extensions(env, id, id.fetches_key.parse_value, results)
end
end