aboutsummaryrefslogtreecommitdiff
path: root/doc/api/cplusplus/examples/example_package_id.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-06-01 13:51:46 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-06-01 13:51:46 +0000
commit87294dc0c47918934ac032e9a080e8cf386f9bf2 (patch)
tree36dc289aa22200601ec28f2d7b497cd078e34ab6 /doc/api/cplusplus/examples/example_package_id.cc
parent3b9f4ed10c9eb6901f33c7037989f3b67eb5de07 (diff)
downloadpaludis-87294dc0c47918934ac032e9a080e8cf386f9bf2.tar.gz
paludis-87294dc0c47918934ac032e9a080e8cf386f9bf2.tar.xz
New Selection + Filter + Generator interface using Environment, replacing the old PackageDatabase Query. Fixes: ticket:559
Diffstat (limited to 'doc/api/cplusplus/examples/example_package_id.cc')
-rw-r--r--doc/api/cplusplus/examples/example_package_id.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/api/cplusplus/examples/example_package_id.cc b/doc/api/cplusplus/examples/example_package_id.cc
index 0ab51fc43..45df420db 100644
--- a/doc/api/cplusplus/examples/example_package_id.cc
+++ b/doc/api/cplusplus/examples/example_package_id.cc
@@ -46,9 +46,8 @@ int main(int argc, char * argv[])
CommandLine::get_instance()->a_environment.argument()));
/* Fetch package IDs for 'sys-apps/paludis'. */
- std::tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))),
- qo_order_by_version));
+ std::tr1::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(
+ generator::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))))]);
/* For each ID: */
for (PackageIDSet::ConstIterator i(ids->begin()), i_end(ids->end()) ;
@@ -123,7 +122,9 @@ int main(int argc, char * argv[])
/* And various misc methods. Clients don't usually use these
* directly. */
- cout << left << setw(30) << " breaks_portage:" << " " << boolalpha << (*i)->breaks_portage() << endl;
+ std::tr1::shared_ptr<const Set<std::string> > breaks_portage((*i)->breaks_portage());
+ cout << left << setw(30) << " breaks_portage:" << " " << join(breaks_portage->begin(),
+ breaks_portage->end(), ", ") << endl;
cout << left << setw(30) << " extra_hash_value:" << " " << "0x" << hex << (*i)->extra_hash_value() << endl;
cout << endl;