Public Member Functions | List of all members
openfluid::utils::CommandLineOption Class Reference

#include <utils/CommandLineParser.hpp>

Public Member Functions

 CommandLineOption ()
 
 CommandLineOption (const std::string &LongName, const std::string &ShortName, const std::string &HelpText, bool ValueRequired=false)
 
std::string getHelpText () const
 
std::string getLongName () const
 
std::string getShortName () const
 
std::string getValue () const
 
bool isActive () const
 
bool isValueRequired () const
 
void activate (const std::string &Value="")
 
void reset ()
 

Constructor & Destructor Documentation

◆ CommandLineOption() [1/2]

openfluid::utils::CommandLineOption::CommandLineOption ( )
inline

◆ CommandLineOption() [2/2]

openfluid::utils::CommandLineOption::CommandLineOption ( const std::string &  LongName,
const std::string &  ShortName,
const std::string &  HelpText,
bool  ValueRequired = false 
)
inline

Instanciates an option with the given parameters

Parameters
[in]LongNameThe long name of the option
[in]ShortNameThe short name of the option
[in]HelpTextThe help text associated to the option
[in]ValueRequiredSet to true to require a value with this option (default is false)

Member Function Documentation

◆ activate()

void openfluid::utils::CommandLineOption::activate ( const std::string &  Value = "")
inline

Activates the option with the given value

Parameters
[in]ValueThe value for activation (default is empty)

◆ getHelpText()

std::string openfluid::utils::CommandLineOption::getHelpText ( ) const
inline

Returns the help text of the option

Returns
The help text

◆ getLongName()

std::string openfluid::utils::CommandLineOption::getLongName ( ) const
inline

Returns the long name of the option (e.g. 'output-dir')

Returns
The long name

◆ getShortName()

std::string openfluid::utils::CommandLineOption::getShortName ( ) const
inline

Returns the short name of the option (e.g. 'o')

Returns
The short name

◆ getValue()

std::string openfluid::utils::CommandLineOption::getValue ( ) const
inline

Returns the value of the option

Returns
The value

◆ isActive()

bool openfluid::utils::CommandLineOption::isActive ( ) const
inline

Tests if the option is active

Returns
true if the option is active

◆ isValueRequired()

bool openfluid::utils::CommandLineOption::isValueRequired ( ) const
inline

Tests if the option requires a value

Returns
true if the option requires a value

◆ reset()

void openfluid::utils::CommandLineOption::reset ( )
inline

Resets the option to default (inactive with empty value)


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