00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef PALUDIS_GUARD_ARGS_ARGS_VISITOR_HH
00022 #define PALUDIS_GUARD_ARGS_ARGS_VISITOR_HH 1
00023
00024 #include <paludis/util/simple_visitor.hh>
00025 #include <paludis/util/wrapped_forward_iterator.hh>
00026 #include <paludis/util/attributes.hh>
00027 #include <string>
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 namespace paludis
00040 {
00041 namespace args
00042 {
00043 class ArgsOption;
00044 class StringArg;
00045 class AliasArg;
00046 class SwitchArg;
00047 class IntegerArg;
00048 class EnumArg;
00049 class StringSetArg;
00050 class StringSequenceArg;
00051
00052
00053
00054
00055
00056
00057 class PALUDIS_VISIBLE ArgsVisitor
00058 {
00059 public:
00060 struct ArgsIteratorTag;
00061 typedef WrappedForwardIterator<ArgsIteratorTag, std::string> ArgsIterator;
00062
00063 private:
00064 ArgsIterator * _args_index, _args_end;
00065 std::string _env_prefix;
00066
00067 const std::string & get_param(const ArgsOption &);
00068
00069 std::string env_name(const std::string & long_name) const;
00070
00071 bool _no;
00072
00073 public:
00074
00075
00076
00077 ArgsVisitor(ArgsIterator *, ArgsIterator,
00078 const std::string & env_prefix = "");
00079
00080
00081 void visit(StringArg &);
00082
00083
00084 void visit(AliasArg &);
00085
00086
00087 void visit(SwitchArg &);
00088
00089
00090 void visit(IntegerArg &);
00091
00092
00093 void visit(EnumArg &);
00094
00095
00096 void visit(StringSetArg &);
00097
00098
00099 void visit(StringSequenceArg &);
00100
00101
00102 void set_no(const bool);
00103 };
00104 }
00105 }
00106
00107 #endif