00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _OASYS_GETOPT_H_
00018 #define _OASYS_GETOPT_H_
00019
00020 #include <string>
00021 #include <vector>
00022 #include "Options.h"
00023
00024 namespace oasys {
00025
00026
00027
00028
00029 class Getopt {
00030 public:
00034 Getopt();
00035
00039 ~Getopt();
00040
00044 void addopt(Opt* opt);
00045
00055 int getopt(const char* progname, int argc, char* const argv[],
00056 const char* extra_usage = "");
00057
00064 void usage(const char* progname,
00065 const char* extra_usage = "");
00066
00067 protected:
00068 typedef std::vector<Opt*> OptList;
00069
00070 Opt* opts_[256];
00071 OptList allopts_;
00072 };
00073
00074 }
00075
00076 #endif