aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-15 14:13:39 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-15 14:13:39 +0000
commit169e91b611f2a12b89467e03abb4c76ddbe3fe7e (patch)
tree2663836792a36cb4b8c05305b3edbdb247edd07b /doc
parent7e125b4740d8bb50aa06b97d1dc070dfbce8bb3a (diff)
downloadpaludis-169e91b611f2a12b89467e03abb4c76ddbe3fe7e.tar.gz
paludis-169e91b611f2a12b89467e03abb4c76ddbe3fe7e.tar.xz
Replace PackageDepSpec::use_requirements with a more general PackageDepSpec::additional_requirements.
Diffstat (limited to 'doc')
-rw-r--r--doc/api/cplusplus/examples/example_dep_spec.cc64
1 files changed, 5 insertions, 59 deletions
diff --git a/doc/api/cplusplus/examples/example_dep_spec.cc b/doc/api/cplusplus/examples/example_dep_spec.cc
index c819d7f74..54fc87726 100644
--- a/doc/api/cplusplus/examples/example_dep_spec.cc
+++ b/doc/api/cplusplus/examples/example_dep_spec.cc
@@ -33,56 +33,6 @@ using std::endl;
using std::setw;
using std::left;
-namespace
-{
- /* Used to print out more information about a UseRequirement. */
- struct UseRequirementPrinter :
- ConstVisitor<UseRequirementVisitorTypes>
- {
- std::ostringstream s;
-
- void visit(const EnabledUseRequirement & r)
- {
- s << "[" << r.flag() << "]";
- }
-
- void visit(const DisabledUseRequirement & r)
- {
- s << "[!" << r.flag() << "]";
- }
-
- void visit(const IfMineThenUseRequirement & r)
- {
- s << "[" << r.flag() << "?] (using '" << *r.package_id() << "')";
- }
-
- void visit(const IfNotMineThenUseRequirement & r)
- {
- s << "[" << r.flag() << "!?] (using '" << *r.package_id() << "')";
- }
-
- void visit(const IfMineThenNotUseRequirement & r)
- {
- s << "[-" << r.flag() << "?] (using '" << *r.package_id() << "')";
- }
-
- void visit(const IfNotMineThenNotUseRequirement & r)
- {
- s << "[-" << r.flag() << "!?] (using '" << *r.package_id() << "')";
- }
-
- void visit(const EqualUseRequirement & r)
- {
- s << "[" << r.flag() << "=] (using '" << *r.package_id() << "')";
- }
-
- void visit(const NotEqualUseRequirement & r)
- {
- s << "[" << r.flag() << "!=] (using '" << *r.package_id() << "')";
- }
- };
-}
-
int main(int argc, char * argv[])
{
try
@@ -154,21 +104,17 @@ int main(int argc, char * argv[])
if (spec.repository_ptr())
cout << " " << left << setw(24) << "Repository:" << " " << *spec.repository_ptr() << endl;
- if (spec.use_requirements_ptr() && ! spec.use_requirements_ptr()->empty())
+ if (spec.additional_requirements_ptr() && ! spec.additional_requirements_ptr()->empty())
{
- cout << " " << left << setw(24) << "Use requirements:" << " ";
+ cout << " " << left << setw(24) << "Additional requirements:" << " ";
bool need_join(false);
- for (UseRequirements::ConstIterator u(spec.use_requirements_ptr()->begin()),
- u_end(spec.use_requirements_ptr()->end()) ; u != u_end ; ++u)
+ for (AdditionalPackageDepSpecRequirements::ConstIterator u(spec.additional_requirements_ptr()->begin()),
+ u_end(spec.additional_requirements_ptr()->end()) ; u != u_end ; ++u)
{
if (need_join)
cout << " and ";
- /* A UseRequirement could be one of various subclasses. We
- * use a visitor to do the right thing. */
- UseRequirementPrinter p;
- (*u)->accept(p);
- cout << p.s.str();
+ cout << (*u)->as_raw_string() + " (meaning: " + (*u)->as_human_string() + ")";
need_join = true;
}
cout << endl;