aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-04 22:08:23 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-04 22:08:23 +0100
commite4445c29bad5f4b6eca307dcb5927ab7ac021df7 (patch)
tree506cf193175dba526c81fbec54469fc7b3c1413c /doc
parentc90d4dec7920a8d70949d8e2e71e704d2800d2c1 (diff)
downloadpaludis-e4445c29bad5f4b6eca307dcb5927ab7ac021df7.tar.gz
paludis-e4445c29bad5f4b6eca307dcb5927ab7ac021df7.tar.xz
Remove PackageID::contents_key
Diffstat (limited to 'doc')
-rw-r--r--doc/api/cplusplus/examples/example_contents.cc7
-rw-r--r--doc/api/ruby/example_contents.rb7
2 files changed, 7 insertions, 7 deletions
diff --git a/doc/api/cplusplus/examples/example_contents.cc b/doc/api/cplusplus/examples/example_contents.cc
index 43375a0f8..a338f6ad1 100644
--- a/doc/api/cplusplus/examples/example_contents.cc
+++ b/doc/api/cplusplus/examples/example_contents.cc
@@ -80,9 +80,9 @@ int main(int argc, char * argv[])
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
{
- /* Do we have a contents key? PackageID _key() methods can return
- * a zero pointer. */
- if (! (*i)->contents_key())
+ /* Do we have contents key?*/
+ auto contents((*i)->contents());
+ if (! contents)
{
cout << "ID '" << **i << "' does not provide a contents key." << endl;
}
@@ -94,7 +94,6 @@ int main(int argc, char * argv[])
* 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(contents->begin()),
indirect_iterator(contents->end()),
diff --git a/doc/api/ruby/example_contents.rb b/doc/api/ruby/example_contents.rb
index 0d5bb0906..98f7cf761 100644
--- a/doc/api/ruby/example_contents.rb
+++ b/doc/api/ruby/example_contents.rb
@@ -23,14 +23,15 @@ ids = env[Selection::AllVersionsSorted.new(
# For each ID:
ids.each do | id |
- # Do we have a contents key? PackageID _key methods can return Nil.
- if not id.contents_key
+ # Do we have contents? This can return nil
+ contents = id.contents
+ if contents
puts "ID '#{id}' does not provide a contents key."
else
puts "ID '#{id}' provides contents key:"
# Contents is made up of a collection of ContentsEntry instances.
- id.contents_key.parse_value.each do | c |
+ contents.each do | c |
# Some ContentsEntry subclasses contain more information than others
if c.kind_of? ContentsOtherEntry