#include <CmdLineParser.h>
Public Member Functions | |
Option (T def, T min, T max) | |
bool | IsSet (unsigned flag) const |
Check if one or more flags are set. | |
Option< T > & | Set (unsigned flag) |
Set one or more flags. | |
Option< T > & | UnSet (unsigned flag) |
Unset one or more flags. | |
Option< T > & | Flags (unsigned flag) |
Reset the current flags and set new ones. | |
Public Attributes | |
T | m_value |
T | m_min |
T | m_max |
bool | m_found |
bool | m_has_alias |
Private Attributes | |
unsigned | m_flags |
CmdLine::Option< T >::Option | ( | T | def, | |
T | min, | |||
T | max | |||
) | [inline] |
bool CmdLine::Option< T >::IsSet | ( | unsigned | flag | ) | const [inline] |
Check if one or more flags are set.
flag | The flag to be checked. To check for more than one flag at a time, use the operator | (or). |
true
if flag
is set; false
otherwise. References CmdLine::Option< T >::m_flags.
Referenced by CmdLine::OptionsType< long double >::CheckDuplicate(), CmdLine::OptionsSTRING::Match(), CmdLine::OptionsCHAR::Match(), CmdLine::OptionsFLOAT::Match(), and CmdLine::OptionsINT::Match().
Option<T>& CmdLine::Option< T >::Set | ( | unsigned | flag | ) | [inline] |
Set one or more flags.
flag | The flag to be set. To set more than one flag at a time, use the operator | (or). |
Option<T>
. References CmdLine::Option< T >::m_flags.
Option<T>& CmdLine::Option< T >::UnSet | ( | unsigned | flag | ) | [inline] |
Unset one or more flags.
flag | The flag to be unset. To unset more than one flag at a time, use the operator | (or). |
Option<T>
. References CmdLine::Option< T >::m_flags.
Option<T>& CmdLine::Option< T >::Flags | ( | unsigned | flag | ) | [inline] |
Reset the current flags and set new ones.
flag | The flag to be set. To set more than one flag at a time, use the operator | (or). |
Option<T>
. References CmdLine::Option< T >::m_flags.
T CmdLine::Option< T >::m_value |
Current value (the last encountered) for the option.
Referenced by CmdLine::OptionsType< long double >::Get(), CmdLine::OptionsSTRING::Match(), CmdLine::OptionsCHAR::Match(), CmdLine::OptionsBOOL::Match(), CmdLine::OptionsFLOAT::Match(), and CmdLine::OptionsINT::Match().
T CmdLine::Option< T >::m_min |
Minimum allowed value (only for numerical types).
Referenced by CmdLine::OptionsFLOAT::Match(), and CmdLine::OptionsINT::Match().
T CmdLine::Option< T >::m_max |
Maximum allowed value (only for numerical types).
Referenced by CmdLine::OptionsFLOAT::Match(), and CmdLine::OptionsINT::Match().
bool CmdLine::Option< T >::m_found |
true
if the option was provided on the command-line; false
otherwise.
Referenced by CmdLine::OptionsType< long double >::CheckDuplicate(), CmdLine::OptionsType< long double >::Found(), CmdLine::OptionsType< long double >::Get(), CmdLine::OptionsSTRING::Match(), CmdLine::OptionsCHAR::Match(), CmdLine::OptionsBOOL::Match(), CmdLine::OptionsFLOAT::Match(), and CmdLine::OptionsINT::Match().
bool CmdLine::Option< T >::m_has_alias |
Indicate if this option has an alias. Used to avoid double free corruption during memory deallocation.
unsigned CmdLine::Option< T >::m_flags [private] |
Custom flags for this option. Currently may hold NONE, SILENT, OUT_OF_RANGE and NO_VALUE flags
Referenced by CmdLine::Option< T >::Flags(), CmdLine::Option< T >::IsSet(), CmdLine::Option< T >::Set(), and CmdLine::Option< T >::UnSet().