Orfeo ToolBox  4.2
Orfeo ToolBox is not a black box
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
otb::CommandLineArgumentParser Class Reference

Utility to Parse command line argument. More...

#include <otbCommandLineArgumentParser.h>

+ Inheritance diagram for otb::CommandLineArgumentParser:
+ Collaboration diagram for otb::CommandLineArgumentParser:

Classes

struct  OptionType
 

Public Types

typedef itk::SmartPointer
< const Self
ConstPointer
 
typedef itk::SmartPointer< SelfPointer
 
typedef CommandLineArgumentParser Self
 
typedef itk::ProcessObject Superclass
 

Public Member Functions

void AddInputImage (bool obligatory=true)
 
void AddOption (const std::string &name, const std::string &comment, const std::string &synonym=NULL, int nParameters=1, bool obligatory=true)
 
void AddOptionNParams (const std::string &name, const std::string &comment, const std::string &synonym=NULL, bool obligatory=true)
 
void AddOutputImage (bool obligatory=true)
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
virtual const char * GetProgramDescription () const
 
void ParseCommandLine (int argc, char *argv[], CommandLineArgumentParseResult *outResult, bool failOnUnknownTrailingParameters=true)
 
virtual void SetProgramDescription (const char *_arg)
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 CommandLineArgumentParser ()
 
virtual ~CommandLineArgumentParser ()
 

Private Types

typedef std::vector< OptionTypeListOptionType
 

Private Member Functions

bool FindOption (const std::string &, int &index)
 
bool IsNumber (const std::string &text)
 
void PrintUsage (std::ostream &os) const
 
void PrintVersion (std::ostream &os) const
 
bool TryParseCommandLine (int argc, char *argv[], CommandLineArgumentParseResult *outResult, bool reportFailedMsg, bool failOnUnknownTrailingParameters)
 

Private Attributes

ListOptionType m_OptionList
 
std::string m_ProgramDescription
 
std::string m_ProgramName
 

Detailed Description

Utility to Parse command line argument.

Usage:

Definition at line 206 of file otbCommandLineArgumentParser.h.

Member Typedef Documentation

Definition at line 212 of file otbCommandLineArgumentParser.h.

Definition at line 271 of file otbCommandLineArgumentParser.h.

Definition at line 211 of file otbCommandLineArgumentParser.h.

Definition at line 209 of file otbCommandLineArgumentParser.h.

Definition at line 210 of file otbCommandLineArgumentParser.h.

Constructor & Destructor Documentation

otb::CommandLineArgumentParser::CommandLineArgumentParser ( )
protected

Definition at line 124 of file otbCommandLineArgumentParser.cxx.

otb::CommandLineArgumentParser::~CommandLineArgumentParser ( )
protectedvirtual

Definition at line 133 of file otbCommandLineArgumentParser.cxx.

Member Function Documentation

void otb::CommandLineArgumentParser::AddInputImage ( bool  obligatory = true)

Add an input image option

Definition at line 137 of file otbCommandLineArgumentParser.cxx.

void otb::CommandLineArgumentParser::AddOption ( const std::string &  name,
const std::string &  comment,
const std::string &  synonym = NULL,
int  nParameters = 1,
bool  obligatory = true 
)
void otb::CommandLineArgumentParser::AddOptionNParams ( const std::string &  name,
const std::string &  comment,
const std::string &  synonym = NULL,
bool  obligatory = true 
)
void otb::CommandLineArgumentParser::AddOutputImage ( bool  obligatory = true)

Add an output image option

Definition at line 143 of file otbCommandLineArgumentParser.cxx.

virtual::itk::LightObject::Pointer otb::CommandLineArgumentParser::CreateAnother ( void  ) const
bool otb::CommandLineArgumentParser::FindOption ( const std::string &  option,
int &  index 
)
private

Definition at line 352 of file otbCommandLineArgumentParser.cxx.

References m_OptionList.

Referenced by TryParseCommandLine().

virtual const char* otb::CommandLineArgumentParser::GetNameOfClass ( ) const
virtual

Reimplemented from itk::ProcessObject.

virtual const char* otb::CommandLineArgumentParser::GetProgramDescription ( ) const
virtual

Get the program name

bool otb::CommandLineArgumentParser::IsNumber ( const std::string &  text)
private

Definition at line 331 of file otbCommandLineArgumentParser.cxx.

Referenced by TryParseCommandLine().

static Pointer otb::CommandLineArgumentParser::New ( )
static
void otb::CommandLineArgumentParser::ParseCommandLine ( int  argc,
char *  argv[],
CommandLineArgumentParseResult outResult,
bool  failOnUnknownTrailingParameters = true 
)

Interpret options from the command line

Definition at line 185 of file otbCommandLineArgumentParser.cxx.

References otb::CommandLineArgumentParseResult::IsOptionPresent().

void otb::CommandLineArgumentParser::PrintUsage ( std::ostream &  os) const
private
void otb::CommandLineArgumentParser::PrintVersion ( std::ostream &  os) const
private

Definition at line 440 of file otbCommandLineArgumentParser.cxx.

virtual void otb::CommandLineArgumentParser::SetProgramDescription ( const char *  _arg)
virtual

Set the program name

bool otb::CommandLineArgumentParser::TryParseCommandLine ( int  argc,
char *  argv[],
CommandLineArgumentParseResult outResult,
bool  reportFailedMsg,
bool  failOnUnknownTrailingParameters 
)
private

Member Data Documentation

ListOptionType otb::CommandLineArgumentParser::m_OptionList
private

Definition at line 273 of file otbCommandLineArgumentParser.h.

Referenced by FindOption(), PrintUsage(), and TryParseCommandLine().

std::string otb::CommandLineArgumentParser::m_ProgramDescription
private

Definition at line 276 of file otbCommandLineArgumentParser.h.

Referenced by PrintUsage().

std::string otb::CommandLineArgumentParser::m_ProgramName
private

Definition at line 275 of file otbCommandLineArgumentParser.h.

Referenced by PrintUsage(), and TryParseCommandLine().


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