Hosting courtesy of Sourceforge

SourceForge Logo
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Parse::CommandLineParser Class Reference

#include <Parse.h>

Inheritance diagram for Parse::CommandLineParser:

Inheritance graph
[legend]
Collaboration diagram for Parse::CommandLineParser:

Collaboration graph
[legend]
List of all members.

Public Methods

 CommandLineParser (int argc, char *argv[], string tagChars="-")

Detailed Description

Parser for Unixesque command line args.

CommandLineParser is used to make the parsing of command line arguments easier. Command line arguments are broken down into two seperate categories.

Identifiers must start with a tag character(passed to constructor) to mark the string as an identifier
Arbitraryly long sequences of values can follow an identifier.

Identifiers are matched to ParseActions via addAction. A space delimited sequence of values in a std::istream& is passed to the ParseAction matching the identifier. The sequence of values passed to each ParseAction is determined by checking for the presense of the leading tag character. If it is there, it is assumed to be an identifier, if it is not, it is assumed to be a value.

Definition at line 137 of file Parse.h.


Constructor & Destructor Documentation

Parse::CommandLineParser::CommandLineParser int    argc,
char *    argv[],
string    tagChars = "-"
 

Parameters:
argc  number of command line arguments
argv  value of C-style command line arguments. argv[0] to argv[argc -1] must be valid. argv[0] is assumed to be the program name, and is thus ignored.
tagChars  string that marks identifiers. All identifiers passed to the addAction() method must start with a character in tagChars, or else their matching ParseAction will not get called.


Member Function Documentation

void Parse::CommandLineParser::read   [virtual]
 

Reimplemented from Parse::Parser.

Definition at line 125 of file Parse.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 21 07:26:56 2002 for BomberLAN by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001