plll  1.0
plll::helper::ArgumentParser::Value Class Reference

Stores the value of one command line argument. More...

#include <arguments.hpp>

Public Member Functions

double getFloat () const
 Return floating point value. More...
 
long getInteger () const
 Return integer value. More...
 
const std::string & getText () const
 Returns the raw text value. More...
 
bool hasOverflow () const
 Checks for overflows. More...
 
bool isEmpty () const
 Tests whether value is empty. More...
 
bool isFloat () const
 Informs whether the result is a floating point number. More...
 
bool isInteger () const
 Informs whether the result is an integer.
 
bool isText () const
 Returns whether the value is text. More...
 

Detailed Description

Stores the value of one command line argument.

Definition at line 66 of file arguments.hpp.

Member Function Documentation

double plll::helper::ArgumentParser::Value::getFloat ( ) const
inline

Return floating point value.

Returns the (native) floating point value, or 0 in case isFloat() returns false. Undefined in case of hasOverflow() == true.

Definition at line 173 of file arguments.hpp.

long plll::helper::ArgumentParser::Value::getInteger ( ) const
inline

Return integer value.

Returns the (native) integer value, or 0 in case isInteger() returns false. Undefined in case of hasOverflow() == true.

Definition at line 152 of file arguments.hpp.

const std::string& plll::helper::ArgumentParser::Value::getText ( ) const
inline

Returns the raw text value.

Returns the raw text value of the command line argument, i.e. the part after = in --blah=value. In case no = was found, -blah (for --blah) or blah (for -blah) itself is returned.

Definition at line 120 of file arguments.hpp.

bool plll::helper::ArgumentParser::Value::hasOverflow ( ) const
inline

Checks for overflows.

Informs in case of an integer or floating point number whether an overflow occured while casting to a native type. In case this returns true, one should use getText() and parse the result using plll::arithmetic::Integer respectively plll::arithmetic::Real.

Definition at line 133 of file arguments.hpp.

bool plll::helper::ArgumentParser::Value::isEmpty ( ) const
inline

Tests whether value is empty.

Allows to test whether the command line argument had a value or not. An argument of the type --blah will have isEmpty() == true, while an argument of the type --blah= will have isEmpty() == false.

Definition at line 97 of file arguments.hpp.

bool plll::helper::ArgumentParser::Value::isFloat ( ) const
inline

Informs whether the result is a floating point number.

Informs whether the result is a floating point number.

Definition at line 162 of file arguments.hpp.

bool plll::helper::ArgumentParser::Value::isText ( ) const
inline

Returns whether the value is text.

Informs whether the command line argument's value is not an integer, floating point number or anything else which could be parsed.

Definition at line 108 of file arguments.hpp.


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