3.0.0
Freundlich's C++ toolkit
Public Types | Public Member Functions
fcppt::options::optional< Parser > Class Template Reference

Detailed Description

template<typename Parser>
class fcppt::options::optional< Parser >

An optional parser.

Wraps a parser such that it may fail. The result type is a record that adds one layer of fcppt::optional::object to the elements of the result type of Parser.

See also
fcppt::options::make_optional

Public Types

typedef fcppt::record::map_elements< fcppt::options::result_of< Parser >, ::brigand::bind< fcppt::optional::object, ::brigand::bind< fcppt::record::element_to_type, ::brigand::_1 > > > result_type
 

Public Member Functions

 optional (Parser &&)
 
 optional (optional const &)
 
 optional (optional &&)
 
optionaloperator= (optional const &)
 
optionaloperator= (optional &&)
 
 ~optional ()
 
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
 

Member Typedef Documentation

◆ result_type

template<typename Parser >
typedef fcppt::record::map_elements< fcppt::options::result_of< Parser >, ::brigand::bind< fcppt::optional::object, ::brigand::bind< fcppt::record::element_to_type, ::brigand::_1 > > > fcppt::options::optional< Parser >::result_type

Constructor & Destructor Documentation

◆ optional() [1/3]

template<typename Parser >
fcppt::options::optional< Parser >::optional ( Parser &&  )
explicit

◆ optional() [2/3]

template<typename Parser >
fcppt::options::optional< Parser >::optional ( optional< Parser > const &  )

◆ optional() [3/3]

template<typename Parser >
fcppt::options::optional< Parser >::optional ( optional< Parser > &&  )

◆ ~optional()

template<typename Parser >
fcppt::options::optional< Parser >::~optional ( )

Member Function Documentation

◆ flag_names()

template<typename Parser >
fcppt::options::flag_name_set fcppt::options::optional< Parser >::flag_names ( ) const

◆ operator=() [1/2]

template<typename Parser >
optional& fcppt::options::optional< Parser >::operator= ( optional< Parser > const &  )

◆ operator=() [2/2]

template<typename Parser >
optional& fcppt::options::optional< Parser >::operator= ( optional< Parser > &&  )

◆ option_names()

template<typename Parser >
fcppt::options::option_name_set fcppt::options::optional< Parser >::option_names ( ) const

◆ parse()

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

◆ usage()

template<typename Parser >
fcppt::string fcppt::options::optional< Parser >::usage ( ) const