13 #pragma warning( disable : 4482)
31 const std::vector<std::string>& args;
32 size_t start_index, index;
47 static const char* k_arg_names[];
50 T ReadNumber(e_arg_types type, T min, T max);
52 bool InVector(
const std::vector<std::string>&
opts,
53 const std::string& to_check);
55 void RaiseError(e_arg_types expected,
double min=0,
double max=0,
56 const std::vector<std::string>* opts = 0);
57 void HasData() {
if (args.size() <= index) RaiseError(kNone); }
61 explicit CArgParser(
const std::vector<std::string>& args,
62 const std::string&
function,
size_t start_index);
63 size_t size()
const {
return args.size() - start_index;}
65 std::string
ReadString(
size_t min=0,
size_t max=0);
68 std::string
ReadStringOneOf(
const std::vector<std::string>& opts,
bool ignorecase=
false);
69 std::wstring
ReadWideStringOneOf(
const std::vector<std::string>& opts,
bool ignorecase=
false);
71 int ReadInt(
int min=INT_MIN,
int max=INT_MAX);
72 unsigned int ReadUInt(
unsigned int min=0,
unsigned int max=UINT_MAX);
73 double ReadDouble(
double min=-DBL_MAX,
double max=DBL_MAX);
74 float ReadFloat(
float min=-FLT_MAX,
float max=FLT_MAX);