00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _ARGS_H_
00020 #define _ARGS_H_
00021
00022
00023
00024
00025 #include "exult_types.h"
00026
00027 #ifdef __DECCXX
00028 # undef declare
00029 #endif
00030
00031 #ifndef ALPHA_LINUX_CXX
00032 # include <string>
00033 #endif
00034 #include <vector>
00035
00036 class Args
00037 {
00038 struct Opts
00039 {
00040 std::string option;
00041 bool *bval;
00042 std::string *sval;
00043 int *ival;
00044 uint32 *uval;
00045
00046 bool dbval;
00047 std::string dsval;
00048 int dival;
00049 uint32 duval;
00050 enum { no_type=0,type_bool,type_string,type_int,type_unsigned } valuetype;
00051 Opts() :option(""),valuetype(no_type) {};
00052 ~Opts() {};
00053 };
00054 std::vector<Opts> options;
00055 public:
00056 Args() {};
00057 ~Args() {};
00058 void declare(const char *s,bool *b,bool defval=true);
00059 void declare(const char *s,std::string *b,const char *defval=0);
00060 void declare(const char *s,int *b,int defval=0);
00061 void declare(const char *s,uint32 *b,uint32 defval=0);
00062 void process(int argc,char **argv);
00063 };
00064
00065 #endif