00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef __OPTIONS_RECORDER_HH__
00047 #define __OPTIONS_RECORDER_HH__
00048
00049 #include "debug.h"
00050 #include "parse_util.hh"
00051
00052
00053 class PropRegistry;
00054
00059 class OptionsRecorder
00060 {
00061
00067 typedef struct t_OptDesc {
00068
00069 static char *kNames[];
00070
00071 enum t_kinds {o_int, o_string, o_bool } kind;
00072 char *name;
00073 char *defVal;
00074
00075 } OptDesc;
00076
00077 public:
00078
00084 OptionsRecorder (PropRegistry ®istry_);
00085
00089 void setOption (const string &key, const string &value)
00090 throw (ParseException);
00091
00092 void OptionsRecorder::setOption (const string &key, const char *value)
00093 throw (ParseException);
00094
00098 void setOption (const string &key, int value)
00099 throw (ParseException);
00100
00104 void setOption (const string &key, bool value)
00105 throw (ParseException);
00106
00111 void checkName (const string &key, OptDesc::t_kinds kind)
00112 throw (ParseException);
00113
00114 #ifdef DEBUG
00115
00119 void dumpRegistry ();
00120
00121 #endif
00122
00123 private:
00124
00132 static OptDesc optDescriptors[];
00133
00138 PropRegistry ®istry;
00139 };
00140
00141 #endif