include/corelib/ncbiargs.hpp File Reference


Detailed Description

Defines command line argument related classes.

The CArgDescriptions and CArgDesc classes are used for describing unparsed arguments; CArgs and CArgValue for parsed argument values; CArgException and CArgHelpException for argument exceptions; and CArgAllow, CArgAllow_{Strings, ..., Integers, Doubles} for argument constraints.

The following description is included as applies to several classes in this file:

Parsing and validation of command-line arguments are done according to user-provided descriptions. The command line has the following syntax:

Command string:

progname {arg_key, arg_key_opt, arg_key_dflt, arg_flag} [--] {arg_pos} {arg_pos_opt, arg_pos_dflt} {arg_extra} {arg_extra_opt}

where:

arg_key := -<key>

-- (mandatory) arg_key_opt := [-<key>

] -- (optional, without default value) arg_key_dflt := [-<key>

] -- (optional, with default value) arg_flag := -<flag> -- (always optional) "--" is an optional delimiter to indicate the beginning of pos. args arg_pos :=

-- (mandatory) arg_pos_opt := [

] -- (optional, without default value) arg_pos_dflt := [

] -- (optional, with default value) arg_extra :=

-- (dep. on the constraint policy) arg_extra_opt := [

] -- (dep. on the constraint policy)

and:

<key> must be followed by

<flag> and <key> are case-sensitive, and they can contain only alphanumeric characters

is an arbitrary string (additional constraints can be applied in the argument description, see "EType")

{arg_pos***} and {arg_extra***} -- position-dependent arguments, with no tag preceding them. {arg_pos***} -- have individual names and descriptions (see methods AddPositional***). {arg_extra***} have one description for all (see method AddExtra). User can apply constraints on the number of mandatory and optional {arg_extra***} arguments.

Definition in file ncbiargs.hpp.

#include <corelib/ncbistd.hpp>
#include <corelib/ncbiobj.hpp>
#include <corelib/ncbi_limits.h>
#include <memory>
#include <set>
#include <list>
#include <vector>

Include dependency graph for ncbiargs.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CArgException
 CArgException --. More...
class  CArgHelpException
 CArgHelpException --. More...
class  CArgValue
 CArgValue --. More...
class  CArgs
 CArgs --. More...
class  CArgErrorHandler
 CArgErrorHandler --. More...
class  CArgDescriptions
 CArgDescriptions --. More...
struct  CArgDescriptions::SArgDependency
class  CArgAllow
 CArgAllow --. More...
class  CArgAllow_Symbols
 CArgAllow_Symbols --. More...
class  CArgAllow_String
 CArgAllow_String --. More...
class  CArgAllow_Strings
 CArgAllow_Strings --. More...
class  CArgAllow_Int8s
 CArgAllow_Int8s --. More...
class  CArgAllow_Integers
 CArgAllow_Integers --. More...
class  CArgAllow_Doubles
 CArgAllow_Doubles --. More...
class  CArgDesc
 CArgDesc --. More...


Generated on Wed Dec 9 05:51:55 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Wed Dec 09 08:18:18 2009 by modify_doxy.py rev. 173732