Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CmdLineParser::t_CmdLineAtom Struct Reference

List of all members.

Public Types

enum  { k_string, k_bool, k_int, k_float }

Public Methods

 t_CmdLineAtom (const string &tag_, bool multi_, bool optional, const string &sOpt_, const string &lOpt_, const string &prop_, const string &description_)
 operator string () const
ostream& dumpDescription (ostream &os) const

Public Attributes

enum CmdLineParser::t_CmdLineAtom:: { ... }  tag
bool multi
bool optional
string sOpt
string lOpt
string prop
string description

Detailed Description

A command line atom (or "option" ) is something like "-c" or "-o foo" or "--enable-things".

Each atom can contain one or more arguments. furthermore, the same atom can appear more than once. The multi field tells how multiple occurence should be handled. If it is false, each occurence will override the previous one. If true, the argument from each occurence is appended to the property that corresponds to that atom.

The tag field (corresponding to the tag field used into the Propregistry) means:

The sOpt and lOpt fields are the option's name (i.e. the bi that appears after the - or --, respectively). Each option can have any of the two forms or both.

If the optional field is true, the optino is, well, optional :)

The description string is a text that indicates the meaning of the option, from the user's point of view. It is used when dumping the command line synopsys.

The prop string is the key of the property that will receive the value(s) of the option.

Definition at line 141 of file cmdline_parser.hh.

Member Enumeration Documentation

anonymous enum

Enumeration values:

Definition at line 143 of file cmdline_parser.hh.

Constructor & Destructor Documentation

CmdLineParser::t_CmdLineAtom::t_CmdLineAtom ( const string & tag_,
bool multi_,
bool optional,
const string & sOpt_,
const string & lOpt_,
const string & prop_,
const string & description_ ) [inline]

Definition at line 151 of file cmdline_parser.hh.

Member Function Documentation

CmdLineParser::t_CmdLineAtom::operator string ( ) const

Returns a string containing the synopsis of this atom.

ostream & CmdLineParser::t_CmdLineAtom::dumpDescription ( ostream & os ) const

Dumps a detailed description of the atom (in the format used by the "options" part of any decent program that implements "--help".

Referenced by CmdLineParser::printUsage().

Member Data Documentation

enum { ... } CmdLineParser::t_CmdLineAtom::tag

bool CmdLineParser::t_CmdLineAtom::multi

Definition at line 144 of file cmdline_parser.hh.

bool CmdLineParser::t_CmdLineAtom::optional

Definition at line 145 of file cmdline_parser.hh.

string CmdLineParser::t_CmdLineAtom::sOpt

Definition at line 146 of file cmdline_parser.hh.

string CmdLineParser::t_CmdLineAtom::lOpt

Definition at line 147 of file cmdline_parser.hh.

string CmdLineParser::t_CmdLineAtom::prop

Definition at line 148 of file cmdline_parser.hh.

string CmdLineParser::t_CmdLineAtom::description

Definition at line 149 of file cmdline_parser.hh.

The documentation for this struct was generated from the following file:
Generated at Tue Jul 9 21:08:37 2002 for CppCC by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001