X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=folded-ctf.git;a=blobdiff_plain;f=param_parser.h;fp=param_parser.h;h=57d0082200178c226328ff5e6f86edb8b04dc340;hp=0000000000000000000000000000000000000000;hb=d922ad61d35e9a6996730bec24b16f8bf7bc426c;hpb=3bb118f5a9462d02ff7d99ef28ecc0d7e23529f9 diff --git a/param_parser.h b/param_parser.h new file mode 100644 index 0000000..57d0082 --- /dev/null +++ b/param_parser.h @@ -0,0 +1,44 @@ + +/////////////////////////////////////////////////////////////////////////// +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the version 3 of the GNU General Public License // +// as published by the Free Software Foundation. // +// // +// This program is distributed in the hope that it will be useful, but // +// WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // +// General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +// // +// Written by Francois Fleuret, (C) IDIAP // +// Contact for comments & bug reports // +/////////////////////////////////////////////////////////////////////////// + +#ifndef PARAM_PARSER_H +#define PARAM_PARSER_H + +#include +#include "misc.h" + +using namespace std; + +class ParamParser { + int _nb_max, _nb; + char **_names, **_values; + bool *_changed; +public: + ParamParser(); + ~ParamParser(); + void add_association(const char *variable_name, const char *variable_value, bool change); + char *get_association(const char *variable_name); + int get_association_int(const char *variable_name); + scalar_t get_association_scalar(const char *variable_name); + bool get_association_bool(const char *variable_name); + + void parse_options(int argc, char **argv, bool allow_undefined, int *new_argc, char **new_argv); + void print_all(ostream *os); +}; + +#endif