OTB  6.7.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private 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 Self
ConstPointer
 
enum  ParseResultType {
  OK,
  NOMODULENAME,
  MULTIPLEMODULENAME,
  INVALIDMODULENAME,
  NOMODULEPATH,
  INVALIDMODULEPATH,
  DEFAULT
}
 
typedef itk::SmartPointer< SelfPointer
 
typedef CommandLineParser Self
 
typedef itk::Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

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
 
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)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
virtual ModifiedTimeType GetMTime () const
 
virtual const std::string & GetObjectName () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 CommandLineParser ()
 
 ~CommandLineParser () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Member Functions

 CommandLineParser (const CommandLineParser &)=delete
 
bool IsAValidKey (const std::string &foundKey)
 
void operator= (const CommandLineParser &)=delete
 

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

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 attribut 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

Definition at line 50 of file otbWrapperCommandLineParser.h.

Definition at line 49 of file otbWrapperCommandLineParser.h.

Standard class typedefs.

Definition at line 47 of file otbWrapperCommandLineParser.h.

Definition at line 48 of file otbWrapperCommandLineParser.h.

Member Enumeration Documentation

Parse result enum

Enumerator
OK 
NOMODULENAME 
MULTIPLEMODULENAME 
INVALIDMODULENAME 
NOMODULEPATH 
INVALIDMODULEPATH 
DEFAULT 

Definition at line 59 of file otbWrapperCommandLineParser.h.

Constructor & Destructor Documentation

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

Constructor

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

Destructor

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

Member Function Documentation

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

Reimplemented from itk::Object.

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

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

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

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

std::string otb::Wrapper::CommandLineParser::GetAttributAsString ( const std::string &  key,
const std::vector< std::string > &  exp 
)
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 "--".

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

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

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 attribut associated to the key m_ModuleNameKey).

CommandLineParser::ParseResultType otb::Wrapper::CommandLineParser::GetModuleName ( std::string &  modName,
const std::vector< 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 attribut associated to the key m_ModuleNameKey).

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

RTTI support

Reimplemented from itk::Object.

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.

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

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

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.

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

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

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

Look if a given key is in an expression.

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

Look if a given key is in an expression.

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

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

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

Defining ::New() static method

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

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