ViSP  2.8.0
vpParseArgv.h
1 /****************************************************************************
2  *
3  * $Id: vpParseArgv.h 2780 2010-09-08 08:37:15Z 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 
133 class VISP_EXPORT vpParseArgv
134 {
135  public:
139  typedef enum {
150  ARGV_END
151  } vpArgvType;
152 
156  typedef enum {
157  ARGV_NO_DEFAULTS = 0x1,
158  ARGV_NO_LEFTOVERS = 0x2,
159  ARGV_NO_ABBREV = 0x4,
160  ARGV_DONT_SKIP_FIRST_ARG = 0x8,
161  ARGV_NO_PRINT = 0x10
162  } vpArgvFlags;
163 
164 #ifndef DOXYGEN_SHOULD_SKIP_THIS
165 
169  typedef struct {
170  const char *key;
172  vpArgvType type;
173  const char *src;
175  const char *dst;
177  const char *help;
178  } vpArgvInfo;
179 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
180 
181 public:
182  static vpArgvInfo defaultTable[2];
183  static bool parse(int *argcPtr, const char **argv,
184  vpArgvInfo *argTable, int flags);
185  static int parse(int argc, const char** argv, const char* validOpts, const char** param);
186 
187  private:
188  static void printUsage (vpArgvInfo *argTable, int flags);
189 
190 
191 
192 } ;
193 
194 
195 #endif
Command line argument parsing.
Definition: vpParseArgv.h:133