CmdLine::Option< T > Class Template Reference

#include <CmdLineParser.h>

Collaboration diagram for CmdLine::Option< T >:

Collaboration graph
[legend]

List of all members.

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

m_value
m_min
m_max
bool m_found
bool m_has_alias

Private Attributes

unsigned m_flags


Detailed Description

template<class T>
class CmdLine::Option< T >

Holds the current value, min and max values for an option.

Constructor & Destructor Documentation

template<class T>
CmdLine::Option< T >::Option ( def,
min,
max 
) [inline]


Member Function Documentation

template<class T>
bool CmdLine::Option< T >::IsSet ( unsigned  flag  )  const [inline]

Check if one or more flags are set.

Parameters:
flag The flag to be checked. To check for more than one flag at a time, use the operator | (or).
Returns:
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().

template<class T>
Option<T>& CmdLine::Option< T >::Set ( unsigned  flag  )  [inline]

Set one or more flags.

Parameters:
flag The flag to be set. To set more than one flag at a time, use the operator | (or).
Returns:
The current object Option<T>.

References CmdLine::Option< T >::m_flags.

template<class T>
Option<T>& CmdLine::Option< T >::UnSet ( unsigned  flag  )  [inline]

Unset one or more flags.

Parameters:
flag The flag to be unset. To unset more than one flag at a time, use the operator | (or).
Returns:
The current object Option<T>.

References CmdLine::Option< T >::m_flags.

template<class T>
Option<T>& CmdLine::Option< T >::Flags ( unsigned  flag  )  [inline]

Reset the current flags and set new ones.

Parameters:
flag The flag to be set. To set more than one flag at a time, use the operator | (or).
Returns:
The current object Option<T>.

References CmdLine::Option< T >::m_flags.


Member Data Documentation

template<class T>
T CmdLine::Option< T >::m_value

template<class T>
T CmdLine::Option< T >::m_min

Minimum allowed value (only for numerical types).

Referenced by CmdLine::OptionsFLOAT::Match(), and CmdLine::OptionsINT::Match().

template<class T>
T CmdLine::Option< T >::m_max

Maximum allowed value (only for numerical types).

Referenced by CmdLine::OptionsFLOAT::Match(), and CmdLine::OptionsINT::Match().

template<class T>
bool CmdLine::Option< T >::m_found

template<class T>
bool CmdLine::Option< T >::m_has_alias

Indicate if this option has an alias. Used to avoid double free corruption during memory deallocation.

See also:
OptionsType::~OptionsType()

template<class T>
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().


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