LTL  2.0.x
Public Member Functions | Protected Attributes | List of all members
util::CommandLineReader Class Reference

Implementation of an util::OptionReader for command line processing. More...

Inherits util::OptionReader.

Public Member Functions

 CommandLineReader (int argc, char *argv[])
 
virtual ~CommandLineReader ()
 
virtual string nextOptionName () throw (UException)
 
virtual string nextOptionValue (const Option *op) throw (UException)
 
virtual bool done ()
 
list< string > fileArguments ()
 
vector< string > fileArgumentsVector ()
 
string progName ()
 

Protected Attributes

int argc_
 
char ** argv_
 
int cur_
 
bool done_
 

Detailed Description

Implementation of an util::OptionReader for command line processing.

Also provides a list (or vector) of file arguments.

Assumed syntax is:

command -s SHORTOPTION --long LONGOPTION ... file_arguments
something -s string -f 1.234 --integerarray 1,2,3,4 file1 file2 file3

File options must follow directly after command. No intervening file arguments!

Constructor & Destructor Documentation

◆ CommandLineReader()

util::CommandLineReader::CommandLineReader ( int  argc,
char *  argv[] 
)

◆ ~CommandLineReader()

virtual util::CommandLineReader::~CommandLineReader ( )
virtual

Member Function Documentation

◆ nextOptionName()

virtual string util::CommandLineReader::nextOptionName ( )
throw (UException
)
virtual

Implements util::OptionReader.

◆ nextOptionValue()

virtual string util::CommandLineReader::nextOptionValue ( const Option op)
throw (UException
)
virtual

Implements util::OptionReader.

◆ done()

virtual bool util::CommandLineReader::done ( )
virtual

Implements util::OptionReader.

◆ fileArguments()

list<string> util::CommandLineReader::fileArguments ( )

◆ fileArgumentsVector()

vector<string> util::CommandLineReader::fileArgumentsVector ( )

◆ progName()

string util::CommandLineReader::progName ( )

Member Data Documentation

◆ argc_

int util::CommandLineReader::argc_
protected

◆ argv_

char** util::CommandLineReader::argv_
protected

◆ cur_

int util::CommandLineReader::cur_
protected

◆ done_

bool util::CommandLineReader::done_
protected