#ifndef GETOPT_H #define GETOPT_H #include #include #include /* Example usage: QString file1, file2; QString o_gamma = "10"; QString o_scale = "0.7"; GetOpt opt(argc, argv); opt.addArgument("img1", "first image", &file1); opt.addArgument("img2", "second image", &file2); opt.addOption('g', "gamma", "weigth to derivatives of images (default: 10)", &o_gamma); opt.addOption('s', "scale", "scale [0.5-0.99] for multiscale approach (default: 0.7)", &o_scale); opt.parse(); */ class GetOpt { protected: struct Option { enum Type { SWITCH, OPTION, ARGUMENT, OPTIONAL }; Type type; char o; QString name; QString description; QVariant *value; bool *b; }; bool unlimitedArgs; QList