53 #include <visp3/core/vpDebug.h>
54 #include <visp3/io/vpParseArgv.h>
56 int main(
int argc,
const char **argv)
62 bool bool_val =
false;
64 long long_val = 33333333;
65 float float_val = 3.14f;
66 double double_val = 3.1415;
67 char *string_val =
nullptr;
69 vpParseArgv::vpArgvInfo argTable[] = {
84 cout <<
"Your parameters: " << endl;
85 cout <<
" Bool value: " << bool_val << endl;
86 cout <<
" Integer value: " << int_val << endl;
87 cout <<
" Long value: " << long_val << endl;
88 cout <<
" Float value: " << float_val << endl;
89 cout <<
" Double value: " << double_val << endl;
90 if (string_val !=
nullptr)
91 cout <<
" String value: " << string_val << endl;
93 cout <<
" String value: \"\"" << endl << endl;
95 cout <<
"Call " << argv[0] <<
" -h to see how to change these parameters." << endl;
99 std::cout <<
"Catch a ViSP exception: " << e.
getStringMessage() << std::endl;
error that can be emitted by ViSP classes.
const std::string & getStringMessage() const
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
@ ARGV_NO_DEFAULTS
No default options like -help.
@ ARGV_DOUBLE
Argument is associated to a double.
@ ARGV_LONG
Argument is associated to a long.
@ ARGV_STRING
Argument is associated to a char * string.
@ ARGV_FLOAT
Argument is associated to a float.
@ ARGV_INT
Argument is associated to an int.
@ ARGV_CONSTANT_BOOL
Stand alone argument associated to a bool var that is set to true.
@ ARGV_END
End of the argument list.
@ ARGV_HELP
Argument is for help displaying.