4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
fcppt::options::switch_< Label > Class Template Reference

Detailed Description

template<typename Label>
class fcppt::options::switch_< Label >

A switch parser.

A switch parser is similar to fcppt::options::flag, but its value type is fixed to bool, where its active value is true and its inactive value is false.

Public Types

using result_type = typename impl::result_type
 

Public Member Functions

 switch_ (fcppt::options::optional_short_name &&short_name, fcppt::options::long_name &&long_name, fcppt::options::optional_help_text &&help_text)
 Constructs a switch parser.
 
fcppt::options::parse_result< result_typeparse (fcppt::options::state &&, fcppt::options::parse_context const &) const
 
fcppt::options::flag_name_set flag_names () const
 
fcppt::options::option_name_set option_names () const
 
fcppt::options::usage usage () const
 
fcppt::options::optional_short_name const & short_name () const
 
fcppt::options::long_name const & long_name () const
 
fcppt::options::optional_help_text const & help_text () const
 

Member Typedef Documentation

◆ result_type

template<typename Label >
using fcppt::options::switch_< Label >::result_type = typename impl::result_type

Constructor & Destructor Documentation

◆ switch_()

template<typename Label >
fcppt::options::switch_< Label >::switch_ ( fcppt::options::optional_short_name && short_name,
fcppt::options::long_name && long_name,
fcppt::options::optional_help_text && help_text )

Constructs a switch parser.

Parameters
short_nameAn optional short name ("-f") this parser will match.
long_nameThe long name ("--flag") this parser will match.
help_textOptional help text for this flag.

Member Function Documentation

◆ flag_names()

template<typename Label >
fcppt::options::flag_name_set fcppt::options::switch_< Label >::flag_names ( ) const
nodiscard

◆ help_text()

template<typename Label >
fcppt::options::optional_help_text const & fcppt::options::switch_< Label >::help_text ( ) const
nodiscard

◆ long_name()

template<typename Label >
fcppt::options::long_name const & fcppt::options::switch_< Label >::long_name ( ) const
nodiscard

◆ option_names()

template<typename Label >
fcppt::options::option_name_set fcppt::options::switch_< Label >::option_names ( ) const
nodiscard

◆ parse()

template<typename Label >
fcppt::options::parse_result< result_type > fcppt::options::switch_< Label >::parse ( fcppt::options::state && ,
fcppt::options::parse_context const &  ) const
nodiscard

◆ short_name()

template<typename Label >
fcppt::options::optional_short_name const & fcppt::options::switch_< Label >::short_name ( ) const
nodiscard

◆ usage()

template<typename Label >
fcppt::options::usage fcppt::options::switch_< Label >::usage ( ) const
nodiscard