diff options
author | 2007-05-26 16:02:17 +0000 | |
---|---|---|
committer | 2007-05-26 16:02:17 +0000 | |
commit | f8241e85c77382c4560ad2c39a86d98587492715 (patch) | |
tree | d6e02a5a1674f83b3409dfc87b1484f93226495c /paludis/args/man.cc | |
parent | 9b7bfeac95df0cbe76fbf60976e789fae2890c5e (diff) | |
download | paludis-f8241e85c77382c4560ad2c39a86d98587492715.tar.gz paludis-f8241e85c77382c4560ad2c39a86d98587492715.tar.xz |
New type safe visitor framework
Diffstat (limited to 'paludis/args/man.cc')
-rw-r--r-- | paludis/args/man.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/paludis/args/man.cc b/paludis/args/man.cc index 13ccc32ce..121e796bb 100644 --- a/paludis/args/man.cc +++ b/paludis/args/man.cc @@ -18,6 +18,7 @@ */ #include "man.hh" +#include <paludis/util/visitor-impl.hh> #include <ostream> #include <sstream> @@ -28,7 +29,7 @@ using std::endl; namespace { struct ExtraText : - ArgsVisitorTypes::ConstVisitor + ConstVisitor<ArgsVisitorTypes> { DocWriter & _dw; @@ -37,50 +38,50 @@ namespace { } - void visit(const ArgsOption * const) + void visit(const ArgsOption &) { } - void visit(const StringArg * const) + void visit(const StringArg &) { } - void visit(const AliasArg * const) + void visit(const AliasArg &) { } - void visit(const SwitchArg * const) + void visit(const SwitchArg &) { } - void visit(const IntegerArg * const) + void visit(const IntegerArg &) { } - void visit(const EnumArg * const e) + void visit(const EnumArg & e) { - if (e->begin_allowed_args() == e->end_allowed_args()) + if (e.begin_allowed_args() == e.end_allowed_args()) return; _dw.start_extra_arg(); - for (EnumArg::AllowedArgIterator a(e->begin_allowed_args()), a_end(e->end_allowed_args()) ; + for (EnumArg::AllowedArgIterator a(e.begin_allowed_args()), a_end(e.end_allowed_args()) ; a != a_end ; ++a) { - _dw.extra_arg_enum(a->first, a->second, e->default_arg()); + _dw.extra_arg_enum(a->first, a->second, e.default_arg()); } _dw.end_extra_arg(); } - void visit(const StringSetArg * const e) + void visit(const StringSetArg & e) { - if (e->begin_allowed_args() == e->end_allowed_args()) + if (e.begin_allowed_args() == e.end_allowed_args()) return; _dw.start_extra_arg(); - for (EnumArg::AllowedArgIterator a(e->begin_allowed_args()), a_end(e->end_allowed_args()) ; + for (EnumArg::AllowedArgIterator a(e.begin_allowed_args()), a_end(e.end_allowed_args()) ; a != a_end ; ++a) { _dw.extra_arg_string_set(a->first, a->second); @@ -116,7 +117,7 @@ paludis::args::generate_doc(DocWriter & dw, const ArgsHandler * const h) dw.arg_group_item((*b)->short_name(), (*b)->long_name(), (*b)->description()); ExtraText t(dw); - (*b)->accept(&t); + (*b)->accept(t); dw.end_arg_group(); } |