00001 #ifndef _theplu_yat_utility_option_switch_
00002 #define _theplu_yat_utility_option_switch_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "Option.h"
00026
00027 #include <string>
00028
00029 namespace theplu {
00030 namespace yat {
00031 namespace utility {
00032
00033 class CommandLine;
00037 class OptionSwitch : public Option
00038 {
00039 public:
00049 OptionSwitch(CommandLine& cmd, std::string name,
00050 std::string desc, bool def=false);
00051
00052
00056 bool value(void) const;
00057
00058 private:
00061 void do_parse(std::vector<std::string>::iterator&,
00062 const std::vector<std::string>::iterator&);
00063
00068 virtual void do_parse2(std::vector<std::string>::iterator,
00069 std::vector<std::string>::iterator);
00070
00073 std::string print2(void) const;
00074
00077 void do_validate(void) const;
00078
00079 private:
00080 bool def_;
00081 bool switch_;
00082 };
00083
00084 }}}
00085
00086 #endif