OpenDaVINCI  4.16.0
odcore::base::CommandLineArgument Class Reference

#include <CommandLineArgument.h>

Public Member Functions

 CommandLineArgument ()
 
 CommandLineArgument (const string &argument, const string &value, const bool &set)
 
virtual ~CommandLineArgument ()
 
bool isSet () const
 
const string getArgument () const
 
template<class T >
getValue ()
 

Protected Attributes

string m_argument
 
string m_value
 
bool m_set
 

Detailed Description

This class represents a command line argument parsed by CommandLineParser. It provides methods to access the argument's name, the argument's value (as arbitrary data type) and to find out whether this argument has been specified in the command line.

Constructor & Destructor Documentation

odcore::base::CommandLineArgument::CommandLineArgument ( )
odcore::base::CommandLineArgument::CommandLineArgument ( const string &  argument,
const string &  value,
const bool &  set 
)

Constructor.

Parameters
argumentCommandline argument to match.
valueValue for the given argument.
odcore::base::CommandLineArgument::~CommandLineArgument ( )
virtual

Member Function Documentation

const std::string odcore::base::CommandLineArgument::getArgument ( ) const

Returns the argument's name.

Returns
The argument's name.

References m_argument.

template<class T >
T odcore::base::CommandLineArgument::getValue ( )
inline

Returns the value of the command line argument as data type T

Referenced by odcontext::base::CommandLineInterface::parse().

bool odcore::base::CommandLineArgument::isSet ( ) const

Returns true if this argument was specified in the command line.

References m_set.

Referenced by odcontext::base::CommandLineInterface::parse().

Member Data Documentation

string odcore::base::CommandLineArgument::m_argument
protected

Referenced by getArgument().

bool odcore::base::CommandLineArgument::m_set
protected

Referenced by isSet().

string odcore::base::CommandLineArgument::m_value
protected