2005/5/9

     
 

class CmdLineParser

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::lang::CmdLineParser Class Reference

#include <CmdLineParser.h>

Inheritance diagram for acdk::lang::CmdLineParser:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

CmdLineParser parses a Commandline (RStringArray) and returns the options.

Author:
Roger Rene Kommer
Version:
Revision
1.15
Date:
Date
2005/02/11 10:12:00


Public Member Functions

 CmdLineParser ()
void addOption (IN(RCmdLineOption) opt)
 Add an Option to this parser.

void addOption (IN(RString) option, IN(RString) alias, bool expectArg, IN(RString) help, bool required=false)
 Add an Option to this parser.

void addOption (IN(RString) option, IN(RString) shortoption, IN(RString) alias, bool expectArg, IN(RString) help, bool required=false)
void printHelp (IN(::acdk::io::RPrintWriter) out)
 dumps out the current configuration set

::acdk::util::RProperties parse (IN(RStringArray) args, bool ignoreUnknown=false, bool stripDetected=false)
 parsed the commandline

::acdk::util::RProperties parse (IN(::acdk::util::RProperties) props, IN(RStringArray) args, bool ignoreUnknown=false, bool stripDetected=false)
 stores the properties in the given props


Public Attributes

::acdk::util::RHashMap _map
RString _helpHeader
RString _helpDetail


Constructor & Destructor Documentation

acdk::lang::CmdLineParser::CmdLineParser  ) 
 


Member Function Documentation

void acdk::lang::CmdLineParser::addOption IN(RString option,
IN(RString shortoption,
IN(RString alias,
bool  expectArg,
IN(RString help,
bool  required = false
[inline]
 

void acdk::lang::CmdLineParser::addOption IN(RString option,
IN(RString alias,
bool  expectArg,
IN(RString help,
bool  required = false
[inline]
 

Add an Option to this parser.

Parameters:
name of command line option
alias used as key to store in Properties
expectArg next command line string will used as value in the Property
help print on screen if parsing fails

void acdk::lang::CmdLineParser::addOption IN(RCmdLineOption opt  ) 
 

Add an Option to this parser.

::acdk::util::RProperties acdk::lang::CmdLineParser::parse IN(::acdk::util::RProperties props,
IN(RStringArray args,
bool  ignoreUnknown = false,
bool  stripDetected = false
 

stores the properties in the given props

::acdk::util::RProperties acdk::lang::CmdLineParser::parse IN(RStringArray args,
bool  ignoreUnknown = false,
bool  stripDetected = false
 

parsed the commandline

Parameters:
args the arguments. The first argumnet (at index 0) will be skipped, because there is normally the name of the executable.
ignoreUnknown ignore unkown option, otherwise throw CmdLineParseException
stripDetected strip away known and parsed options Only evaluated if ignoreUnknown is also been set.
Returns:
the parsed option

void acdk::lang::CmdLineParser::printHelp IN(::acdk::io::RPrintWriter out  ) 
 

dumps out the current configuration set


Member Data Documentation

RString acdk::lang::CmdLineParser::_helpDetail
 

RString acdk::lang::CmdLineParser::_helpHeader
 

::acdk::util::RHashMap acdk::lang::CmdLineParser::_map