ViSP  2.9.0
vpParseArgv.h
1 /****************************************************************************
2  *
3  * $Id: vpParseArgv.h 4473 2013-09-27 16:50:44Z fspindle $
4  *
5  * Declarations for Tk-related things that are visible
6  * outside of the Tk module itself.
7  *
8  * Copyright 1989-1992 Regents of the University of California.
9  * Permission to use, copy, modify, and distribute this
10  * software and its documentation for any purpose and without
11  * fee is hereby granted, provided that the above copyright
12  * notice appear in all copies. The University of California
13  * makes no representations about the suitability of this
14  * software for any purpose. It is provided "as is" without
15  * express or implied warranty.
16  *
17  * This file has been modified to be used only for argv parsing without
18  * reference to tk, tcl or X11. Base on tk.h from tk2.3
19  *
20  * Description:
21  * Command line argument parsing.
22  *
23  * Authors:
24  * Fabien Spindler (modification of the original version)
25  *
26  *****************************************************************************/
27 
33 #ifndef vpParseArgv_h
34 #define vpParseArgv_h
35 
36 
37 #include <visp/vpConfig.h>
38 #include <visp/vpException.h>
39 
134 class VISP_EXPORT vpParseArgv
135 {
136  public:
140  typedef enum {
151  ARGV_END
152  } vpArgvType;
153 
157  typedef enum {
158  ARGV_NO_DEFAULTS = 0x1,
159  ARGV_NO_LEFTOVERS = 0x2,
160  ARGV_NO_ABBREV = 0x4,
161  ARGV_DONT_SKIP_FIRST_ARG = 0x8,
162  ARGV_NO_PRINT = 0x10
163  } vpArgvFlags;
164 
165 #ifndef DOXYGEN_SHOULD_SKIP_THIS
166 
170  typedef struct {
171  const char *key;
173  vpArgvType type;
174  const char *src;
176  const char *dst;
178  const char *help;
179  } vpArgvInfo;
180 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
181 
182 public:
183  static vpArgvInfo defaultTable[2];
184  static bool parse(int *argcPtr, const char **argv,
185  vpArgvInfo *argTable, int flags);
186  static int parse(int argc, const char** argv, const char* validOpts, const char** param);
187 
188  private:
189  static void printUsage (vpArgvInfo *argTable, int flags);
190 
191 
192 
193 } ;
194 
195 
196 #endif
Command line argument parsing.
Definition: vpParseArgv.h:134