Visual Servoing Platform
version 3.2.0 under development (2019-01-22)
|
#include <visp3/io/vpParseArgv.h>
Public Types | |
enum | vpArgvType { ARGV_CONSTANT, ARGV_CONSTANT_INT, ARGV_CONSTANT_BOOL, ARGV_INT, ARGV_LONG, ARGV_STRING, ARGV_REST, ARGV_FLOAT, ARGV_DOUBLE, ARGV_FUNC, ARGV_GENFUNC, ARGV_HELP, ARGV_END } |
enum | vpArgvFlags { ARGV_NO_DEFAULTS = 0x1, ARGV_NO_LEFTOVERS = 0x2, ARGV_NO_ABBREV = 0x4, ARGV_DONT_SKIP_FIRST_ARG = 0x8, ARGV_NO_PRINT = 0x10 } |
Static Public Member Functions | |
static bool | parse (int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags) |
static int | parse (int argc, const char **argv, const char *validOpts, const char **param) |
Static Public Attributes | |
static vpArgvInfo | defaultTable [2] |
Command line argument parsing.
The code below shows a first way to parse command line arguments using vpParseArgv class. It allows to specify an option name with more than one character.
The code below shows an other way to parse command line arguments using vpParseArgv class. Here command line options are only one character long.
Definition at line 148 of file vpParseArgv.h.
Flag bits.
Definition at line 175 of file vpParseArgv.h.
Legal values for the type field of a vpArgvInfo.
Definition at line 154 of file vpParseArgv.h.
|
static |
Process an argv array according to a table of expectedvcommand-line options.
The return value is a boolean value with true indicating an error. If an error occurs then an error message is printed on stderr. Under normal conditions, both *argcPtr and *argv are modified to return the arguments that couldn't be processed here (they didn't match the option table, or followed an vpParseArgv::ARGV_REST argument).
argcPtr | Pointer to the count of command line arguments. |
argv | Array of command line argument strings. |
argTable | Array of command-specific argument descriptions. |
flags | This parameter is to set with vpParseArgv::vpArgvFlags values or combinations of these values using the OR operator (vpParseArgv::ARGV_NO_LEFTOVERS | vpParseArgv::ARGV_NO_DEFAULTS). If the vpParseArgv::ARGV_NO_DEFAULTS bit is set, then don't generate information for default options. |
Definition at line 69 of file vpParseArgv.cpp.
References ARGV_CONSTANT, ARGV_CONSTANT_BOOL, ARGV_CONSTANT_INT, ARGV_DONT_SKIP_FIRST_ARG, ARGV_DOUBLE, ARGV_END, ARGV_FLOAT, ARGV_FUNC, ARGV_GENFUNC, ARGV_HELP, ARGV_INT, ARGV_LONG, ARGV_NO_ABBREV, ARGV_NO_DEFAULTS, ARGV_NO_LEFTOVERS, ARGV_REST, ARGV_STRING, and defaultTable.
|
static |
Get next command line option and parameter.
argc | Count of command line arguments. |
argv | Array of command line argument strings. |
validOpts | String of valid case-sensitive option characters, a ':' following a given character means that option can take a parameter. |
param | Pointer to a pointer to a string for output. |
Definition at line 498 of file vpParseArgv.cpp.
|
static |
Definition at line 204 of file vpParseArgv.h.
Referenced by parse().