00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _OASYS_OPTPARSER_H_
00018 #define _OASYS_OPTPARSER_H_
00019
00020 #include <string>
00021 #include <vector>
00022 #include "Options.h"
00023
00024 namespace oasys {
00025
00026
00027
00028
00029
00030 class OptParser {
00031 public:
00035 virtual ~OptParser();
00036
00041 void addopt(Opt* opt);
00042
00051 bool parse(const char* args, const char** invalidp = NULL);
00052
00061 bool parse(int argc, const char* const argv[],
00062 const char** invalidp = NULL);
00063
00072 int parse_and_shift(int argc, const char* argv[],
00073 const char** invalidp = NULL);
00074
00083 bool parse(const std::vector<std::string>& args,
00084 const char** invalidp = NULL);
00085
00090 bool parse_opt(const char* opt, size_t len,
00091 bool* invalid_value = NULL);
00092
00093 protected:
00094 typedef std::vector<Opt*> OptList;
00095 OptList allopts_;
00096 };
00097
00098 }
00099
00100 #endif