OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | List of all members
otb::Wrapper::CommandLineParser Class Reference

#include <otbWrapperCommandLineParser.h>

+ Inheritance diagram for otb::Wrapper::CommandLineParser:
+ Collaboration diagram for otb::Wrapper::CommandLineParser:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
enum  ParseResultType {
  OK,
  NOMODULENAME,
  MULTIPLEMODULENAME,
  INVALIDMODULENAME,
  NOMODULEPATH,
  INVALIDMODULEPATH,
  DEFAULT
}
 
typedef itk::SmartPointer< SelfPointer
 
typedef CommandLineParser Self
 
typedef itk::Object Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
std::vector< std::string > GetAttribut (const std::string &key, const std::string &exp)
 
std::vector< std::string > GetAttribut (const std::string &key, const std::vector< std::string > &exp)
 
std::string GetAttributAsString (const std::string &key, const std::string &exp)
 
std::string GetAttributAsString (const std::string &key, const std::vector< std::string > &exp)
 
virtual const char * GetNameOfClass () const
 

Static Public Member Functions

static Pointer New ()
 
bool IsAttributExists (const std::string &key, const std::string &exp)
 
bool IsAttributExists (const std::string &key, const std::vector< std::string > &exp)
 
CommandLineParser::ParseResultType GetPaths (std::vector< std::string > &paths, const std::string &exp)
 
CommandLineParser::ParseResultType GetPaths (std::vector< std::string > &paths, const std::vector< std::string > &exp)
 
std::string GetPathsAsString (const std::string &exp)
 
std::string GetPathsAsString (const std::vector< std::string > &vexp)
 
CommandLineParser::ParseResultType GetModuleName (std::string &modName, const std::string &exp)
 
CommandLineParser::ParseResultType GetModuleName (std::string &modName, const std::vector< std::string > &exp)
 
std::vector< std::string > GetKeyList (const std::string &exp)
 
std::vector< std::string > GetKeyList (const std::vector< std::string > &exp)
 
 CommandLineParser ()
 
 ~CommandLineParser () override
 
 CommandLineParser (const CommandLineParser &)=delete
 
void operator= (const CommandLineParser &)=delete
 
bool IsAValidKey (const std::string &foundKey)
 

Detailed Description

This class check the validity of a command line application.

To be valid, the expression must be as follow: ModuleName (ModulePaths) –attribut1_Key attrubut1_Value –attribut2_Key attrubut2_Value After the attribute key, if the user give several values (expression without "--" separated by space), it will automacally be interpreted as a list.

Definition at line 43 of file otbWrapperCommandLineParser.h.

Member Typedef Documentation

◆ ConstPointer

typedef itk::SmartPointer<const Self> otb::Wrapper::CommandLineParser::ConstPointer

Definition at line 50 of file otbWrapperCommandLineParser.h.

◆ Pointer

typedef itk::SmartPointer<Self> otb::Wrapper::CommandLineParser::Pointer

Definition at line 49 of file otbWrapperCommandLineParser.h.

◆ Self

Standard class typedefs.

Definition at line 47 of file otbWrapperCommandLineParser.h.

◆ Superclass

Definition at line 48 of file otbWrapperCommandLineParser.h.

Member Enumeration Documentation

◆ ParseResultType

Parse result enum

Enumerator
OK 
NOMODULENAME 
MULTIPLEMODULENAME 
INVALIDMODULENAME 
NOMODULEPATH 
INVALIDMODULEPATH 
DEFAULT 

Definition at line 59 of file otbWrapperCommandLineParser.h.

Constructor & Destructor Documentation

◆ CommandLineParser() [1/2]

otb::Wrapper::CommandLineParser::CommandLineParser ( )
protected

Constructor

◆ ~CommandLineParser()

otb::Wrapper::CommandLineParser::~CommandLineParser ( )
overrideprotected

Destructor

◆ CommandLineParser() [2/2]

otb::Wrapper::CommandLineParser::CommandLineParser ( const CommandLineParser )
privatedelete

Look if a given key is in an expression.

Member Function Documentation

◆ CreateAnother()

virtual::itk::LightObject::Pointer otb::Wrapper::CommandLineParser::CreateAnother ( void  ) const

◆ GetAttribut() [1/2]

std::vector<std::string> otb::Wrapper::CommandLineParser::GetAttribut ( const std::string &  key,
const std::string &  exp 
)

Get the attribute associated to a key (list of element after the key and before the next "--") as a vector of string.

◆ GetAttribut() [2/2]

std::vector<std::string> otb::Wrapper::CommandLineParser::GetAttribut ( const std::string &  key,
const std::vector< std::string > &  exp 
)

◆ GetAttributAsString() [1/2]

std::string otb::Wrapper::CommandLineParser::GetAttributAsString ( const std::string &  key,
const std::string &  exp 
)

Get the attribute associated to a key (list of element after the key and before the next "--") as a string separated by spaces.

◆ GetAttributAsString() [2/2]

std::string otb::Wrapper::CommandLineParser::GetAttributAsString ( const std::string &  key,
const std::vector< std::string > &  exp 
)

◆ GetKeyList() [1/2]

std::vector<std::string> otb::Wrapper::CommandLineParser::GetKeyList ( const std::string &  exp)

Get the list of keys in an expression. That is to say each word starting by "--".

◆ GetKeyList() [2/2]

std::vector<std::string> otb::Wrapper::CommandLineParser::GetKeyList ( const std::vector< std::string > &  exp)

Look if a given key is in an expression.

◆ GetModuleName() [1/2]

CommandLineParser::ParseResultType otb::Wrapper::CommandLineParser::GetModuleName ( std::string &  modName,
const std::string &  exp 
)

Get the module name in an expression. It can be the first element of the expression (if the expression doesn't start with a "--" or the attribute associated to the key m_ModuleNameKey).

◆ GetModuleName() [2/2]

CommandLineParser::ParseResultType otb::Wrapper::CommandLineParser::GetModuleName ( std::string &  modName,
const std::vector< std::string > &  exp 
)

Look if a given key is in an expression.

◆ GetNameOfClass()

virtual const char* otb::Wrapper::CommandLineParser::GetNameOfClass ( ) const
virtual

RTTI support

◆ GetPaths() [1/2]

CommandLineParser::ParseResultType otb::Wrapper::CommandLineParser::GetPaths ( std::vector< std::string > &  paths,
const std::string &  exp 
)

Get the paths executables in an expression. Store the list in a vector of string.

◆ GetPaths() [2/2]

CommandLineParser::ParseResultType otb::Wrapper::CommandLineParser::GetPaths ( std::vector< std::string > &  paths,
const std::vector< std::string > &  exp 
)

Look if a given key is in an expression.

◆ GetPathsAsString() [1/2]

std::string otb::Wrapper::CommandLineParser::GetPathsAsString ( const std::string &  exp)

Get the paths executables in an expression. Store the list in a vector of string.

◆ GetPathsAsString() [2/2]

std::string otb::Wrapper::CommandLineParser::GetPathsAsString ( const std::vector< std::string > &  vexp)

Look if a given key is in an expression.

◆ IsAttributExists() [1/2]

bool otb::Wrapper::CommandLineParser::IsAttributExists ( const std::string &  key,
const std::string &  exp 
)

Look if a given key is in an expression.

◆ IsAttributExists() [2/2]

bool otb::Wrapper::CommandLineParser::IsAttributExists ( const std::string &  key,
const std::vector< std::string > &  exp 
)

Look if a given key is in an expression.

◆ IsAValidKey()

bool otb::Wrapper::CommandLineParser::IsAValidKey ( const std::string &  foundKey)
private

Return true if the found key is valid : not a number

◆ New()

static Pointer otb::Wrapper::CommandLineParser::New ( )
static

Defining ::New() static method

◆ operator=()

void otb::Wrapper::CommandLineParser::operator= ( const CommandLineParser )
privatedelete

Look if a given key is in an expression.


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