Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

ArgumentParser Class Reference

Parses the command line arguments and stores the configuration after parsing. More...

#include <argumentparser.hpp>

List of all members.

Public Member Functions

 ArgumentParser ()
virtual ~ArgumentParser ()
bool parseArguments (int argc, char **argv)
uint numArguments () const
string argValue (const string &arg) const
bool boolArgValue (const string &arg) const
bool singleArgSet (char arg) const

Private Attributes

map< string, string > ArgsMap
string NoParamArgs


Detailed Description

Parses the command line arguments and stores the configuration after parsing.

Author:
Frederik Holljen
Date:
Enter current date here

Definition at line 20 of file argumentparser.hpp.


Constructor & Destructor Documentation

ArgumentParser::ArgumentParser  ) 
 

Default constructor

Definition at line 51 of file argumentparser.cpp.

ArgumentParser::~ArgumentParser  )  [virtual]
 

Destroys the object

Definition at line 60 of file argumentparser.cpp.


Member Function Documentation

bool ArgumentParser::boolArgValue const string &  arg  )  const
 

Returns the boolean value of the argument arg. Returns an empty string if the argument was not specified. true, 1 and on are accepted as true, all other values are false.

Definition at line 144 of file argumentparser.cpp.

References mapIt.

uint ArgumentParser::numArguments  )  const
 

Returns the number of arguments parsed.

Definition at line 118 of file argumentparser.cpp.

bool ArgumentParser::parseArguments int  argc,
char **  argv
 

Parses the arguments. Returns true if the arguments are valid and the program should continue. This function accepts the following: -a param ; // standard with parameter -a ; // no parameter -ab ; // a and b are both parameterless -ab param; // a has no param, b does

Definition at line 73 of file argumentparser.cpp.

bool ArgumentParser::singleArgSet char  arg  )  const
 

Returns true if the character arg was set in any of the allowed ways.

Definition at line 163 of file argumentparser.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Dec 1 14:26:28 2003 for Ck by doxygen 1.3.3