55 #include <visp3/core/vpDebug.h> 56 #include <visp3/io/vpParseArgv.h> 58 int main(
int argc,
const char **argv)
64 bool bool_val =
false;
66 long long_val = 33333333;
67 float float_val = 3.14f;
68 double double_val = 3.1415;
69 char *string_val = NULL;
71 vpParseArgv::vpArgvInfo argTable[] = {
86 cout <<
"Your parameters: " << endl;
87 cout <<
" Bool value: " << bool_val << endl;
88 cout <<
" Integer value: " << int_val << endl;
89 cout <<
" Long value: " << long_val << endl;
90 cout <<
" Float value: " << float_val << endl;
91 cout <<
" Double value: " << double_val << endl;
92 if (string_val != NULL)
93 cout <<
" String value: " << string_val << endl;
95 cout <<
" String value: \"\"" << endl << endl;
97 cout <<
"Call " << argv[0] <<
" -h to see how to change these parameters." << endl;
101 std::cout <<
"Catch a ViSP exception: " << e.
getStringMessage() << std::endl;
Argument is associated to a double.
End of the argument list.
Stand alone argument associated to a bool var that is set to true.
Argument is associated to a char * string.
Argument is for help displaying.
error that can be emited by ViSP classes.
Argument is associated to a long.
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
Argument is associated to a float.
Command line argument parsing.
No default options like -help.
const std::string & getStringMessage() const
Send a reference (constant) related the error message (can be empty).
Argument is associated to an int.