Visual Servoing Platform  version 3.6.1 under development (2024-03-29)
vpParseArgv.h
1 /*
2  * Declarations for Tk-related things that are visible
3  * outside of the Tk module itself.
4  *
5  * Copyright 1989-1992 Regents of the University of California.
6  * Permission to use, copy, modify, and distribute this
7  * software and its documentation for any purpose and without
8  * fee is hereby granted, provided that the above copyright
9  * notice appear in all copies. The University of California
10  * makes no representations about the suitability of this
11  * software for any purpose. It is provided "as is" without
12  * express or implied warranty.
13  *
14  * This file has been modified to be used only for argv parsing without
15  * reference to tk, tcl or X11. Base on tk.h from tk2.3
16  *
17  * Modifications by Peter Neelin (November 27, 1992)
18  * Modifications by Fabien Spindler (June 20, 2006)
19  */
20 
26 #ifndef vpParseArgv_h
27 #define vpParseArgv_h
28 
29 #include <visp3/core/vpConfig.h>
30 #include <visp3/core/vpException.h>
31 
142 class VISP_EXPORT vpParseArgv
143 {
144 public:
148  typedef enum {
161  ARGV_END
162  } vpArgvType;
163 
167  typedef enum {
168  ARGV_NO_DEFAULTS = 0x1,
169  ARGV_NO_LEFTOVERS = 0x2,
170  ARGV_NO_ABBREV = 0x4,
172  ARGV_DONT_SKIP_FIRST_ARG = 0x8,
173  ARGV_NO_PRINT = 0x10
174  } vpArgvFlags;
175 
176 #ifndef DOXYGEN_SHOULD_SKIP_THIS
181  typedef struct {
182  const char *key;
183  vpArgvType type;
184  const char *src;
185  const char *dst;
186  const char *help;
187  } vpArgvInfo;
188 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
189 
190 public:
191  static vpArgvInfo defaultTable[2];
192  static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags);
193  static int parse(int argc, const char **argv, const char *validOpts, const char **param);
194 
195 private:
196  static void printUsage(vpArgvInfo *argTable, int flags);
197 };
198 
199 #endif
Command line argument parsing.
Definition: vpParseArgv.h:143
@ ARGV_DOUBLE
Argument is associated to a double.
Definition: vpParseArgv.h:157
@ ARGV_LONG
Argument is associated to a long.
Definition: vpParseArgv.h:153
@ ARGV_STRING
Argument is associated to a char * string.
Definition: vpParseArgv.h:154
@ ARGV_FLOAT
Argument is associated to a float.
Definition: vpParseArgv.h:156
@ ARGV_CONSTANT
Stand alone argument. Same as vpParseArgv::ARGV_CONSTANT_INT.
Definition: vpParseArgv.h:149
@ ARGV_INT
Argument is associated to an int.
Definition: vpParseArgv.h:152
@ ARGV_CONSTANT_BOOL
Stand alone argument associated to a bool var that is set to true.
Definition: vpParseArgv.h:151
@ ARGV_CONSTANT_INT
Stand alone argument associated to an int var that is set to 1.
Definition: vpParseArgv.h:150
@ ARGV_HELP
Argument is for help displaying.
Definition: vpParseArgv.h:160