2.10.0
Freundlich's C++ toolkit
Public Types | Public Member Functions
fcppt::options::unit_switch< Label > Class Template Reference

Detailed Description

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

A required switch.

This parser is similar to fcppt::options::switch_ but it requires its switch to be specified.

Public Types

typedef fcppt::record::variadic< fcppt::record::element< Label, fcppt::unit > > result_type
 

Public Member Functions

 unit_switch (fcppt::options::optional_short_name &&short_name, fcppt::options::long_name &&long_name)
 Constructs a switch parser. More...
 
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::string usage () const
 
fcppt::options::optional_short_name const & short_name () const
 
fcppt::options::long_name const & long_name () const
 

Member Typedef Documentation

◆ result_type

template<typename Label >
typedef fcppt::record::variadic< fcppt::record::element< Label, fcppt::unit > > fcppt::options::unit_switch< Label >::result_type

Constructor & Destructor Documentation

◆ unit_switch()

template<typename Label >
fcppt::options::unit_switch< Label >::unit_switch ( fcppt::options::optional_short_name &&  short_name,
fcppt::options::long_name &&  long_name 
)

Constructs a switch parser.

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

Member Function Documentation

◆ flag_names()

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

◆ long_name()

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

◆ option_names()

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

◆ parse()

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

◆ short_name()

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

◆ usage()

template<typename Label >
fcppt::string fcppt::options::unit_switch< Label >::usage ( ) const