NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Member Functions | List of all members
niftk::CommandLineParser Class Reference

Parser for extracting program arguments from the command line. More...

Public Member Functions

int GetArgument (int, void *)
 
int GetArgument (int, bool &value)
 Get back a bool argument out of parsed command line. More...
 
int GetArgument (int, unsigned int &value)
 Get back an unsigned int argument out of parsed command line. More...
 
int GetArgument (int, int &value)
 Get back an int argument out of parsed command line. More...
 
int GetArgument (int, int *&value)
 Get back an int pointer argument out of parsed command line. More...
 
int GetArgument (int, float &value)
 Get back an float argument out of parsed command line. More...
 
int GetArgument (int, float *&value)
 Get back an float pointer argument out of parsed command line. More...
 
int GetArgument (int, double &value)
 Get back an double argument out of parsed command line. More...
 
int GetArgument (int, double *&value)
 Get back an double pointer argument out of parsed command line. More...
 
int GetArgument (int, char *&value)
 Get back a char string argument out of parsed command line. More...
 
int GetArgument (int, std::string &value)
 Get back a standard string argument out of parsed command line. More...
 
int GetArgument (int, long int &value)
 Get back a long int argument out of parsed command line. More...
 
Special Member Functions
 CommandLineParser (int argc, char *argv[], struct CommandLineArgumentDescription *clArgList, bool flgVerbose)
 CommandLineParser Constructor. More...
 
 ~CommandLineParser ()
 CommandLineParser Destructor. More...
 
 CommandLineParser (const CommandLineParser &source)
 CommandLineParser copy constructor. More...
 
void PrintUsage (void)
 Printing member function for CommandLineParser. More...
 

Detailed Description

Parser for extracting program arguments from the command line.

This class parses the command line using an array 'clArgList' of structures of type 'CommandLineArgumentDescription' terminated in:

'{OPT_DONE, 0, 0, "Insert brief program description here"}'.

For an example of how to use the range of command line option types please see program 'NifTK/Prototype/jhh/niftkCommandLineParserExample'.

See also
CommandLineArgumentDescription
niftkCommandLineParserExample.cxx

Constructor & Destructor Documentation

niftk::CommandLineParser::CommandLineParser ( int  argc,
char *  argv[],
struct CommandLineArgumentDescription clArgList,
bool  flgVerbose 
)

CommandLineParser Constructor.

niftk::CommandLineParser::~CommandLineParser ( )

CommandLineParser Destructor.

niftk::CommandLineParser::CommandLineParser ( const CommandLineParser source)

CommandLineParser copy constructor.

Member Function Documentation

int niftk::CommandLineParser::GetArgument ( int  optnum,
void dataptr 
)

Get back a particular argument out of parsed command line. This method is deprecated, use overloaded versions instead.

int niftk::CommandLineParser::GetArgument ( int  optnum,
bool &  value 
)

Get back a bool argument out of parsed command line.

int niftk::CommandLineParser::GetArgument ( int  optnum,
unsigned int value 
)

Get back an unsigned int argument out of parsed command line.

int niftk::CommandLineParser::GetArgument ( int  optnum,
int value 
)

Get back an int argument out of parsed command line.

int niftk::CommandLineParser::GetArgument ( int  optnum,
int *&  value 
)

Get back an int pointer argument out of parsed command line.

int niftk::CommandLineParser::GetArgument ( int  optnum,
float &  value 
)

Get back an float argument out of parsed command line.

int niftk::CommandLineParser::GetArgument ( int  optnum,
float *&  value 
)

Get back an float pointer argument out of parsed command line.

int niftk::CommandLineParser::GetArgument ( int  optnum,
double &  value 
)

Get back an double argument out of parsed command line.

int niftk::CommandLineParser::GetArgument ( int  optnum,
double *&  value 
)

Get back an double pointer argument out of parsed command line.

int niftk::CommandLineParser::GetArgument ( int  optnum,
char *&  value 
)

Get back a char string argument out of parsed command line.

int niftk::CommandLineParser::GetArgument ( int  optnum,
std::string value 
)

Get back a standard string argument out of parsed command line.

int niftk::CommandLineParser::GetArgument ( int  optnum,
long int value 
)

Get back a long int argument out of parsed command line.

void niftk::CommandLineParser::PrintUsage ( void  )
inline

Printing member function for CommandLineParser.


The documentation for this class was generated from the following files: