2.10.0
Freundlich's C++ toolkit
Classes | Public Types | Public Member Functions
fcppt::options::sum< Label, Left, Right > Class Template Reference

Detailed Description

template<typename Label, typename Left, typename Right>
class fcppt::options::sum< Label, Left, Right >

A sum of two parsers.

This parser first tries its left parser and if that succeeds returns its result. Otherwise, it tries the right parser and returns its result.

Classes

struct  left
 
struct  right
 

Public Types

typedef fcppt::options::result_of< Left > left_result
 
typedef fcppt::options::result_of< Right > right_result
 
typedef fcppt::variant::variadic< fcppt::options::left< left_result >, fcppt::options::right< right_result > > variant
 
typedef fcppt::record::variadic< fcppt::record::element< Label, variant > > result_type
 

Public Member Functions

 sum (Left &&, Right &&)
 
 sum (sum const &)
 
 sum (sum &&)
 
sumoperator= (sum const &)
 
sumoperator= (sum &&)
 
 ~sum ()
 
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

◆ left_result

template<typename Label , typename Left , typename Right >
typedef fcppt::options::result_of< Left > fcppt::options::sum< Label, Left, Right >::left_result

◆ result_type

template<typename Label , typename Left , typename Right >
typedef fcppt::record::variadic< fcppt::record::element< Label, variant > > fcppt::options::sum< Label, Left, Right >::result_type

◆ right_result

template<typename Label , typename Left , typename Right >
typedef fcppt::options::result_of< Right > fcppt::options::sum< Label, Left, Right >::right_result

◆ variant

template<typename Label , typename Left , typename Right >
typedef fcppt::variant::variadic< fcppt::options::left< left_result >, fcppt::options::right< right_result > > fcppt::options::sum< Label, Left, Right >::variant

Constructor & Destructor Documentation

◆ sum() [1/3]

template<typename Label , typename Left , typename Right >
fcppt::options::sum< Label, Left, Right >::sum ( Left &&  ,
Right &&   
)

◆ sum() [2/3]

template<typename Label , typename Left , typename Right >
fcppt::options::sum< Label, Left, Right >::sum ( sum< Label, Left, Right > const &  )

◆ sum() [3/3]

template<typename Label , typename Left , typename Right >
fcppt::options::sum< Label, Left, Right >::sum ( sum< Label, Left, Right > &&  )

◆ ~sum()

template<typename Label , typename Left , typename Right >
fcppt::options::sum< Label, Left, Right >::~sum ( )

Member Function Documentation

◆ flag_names()

template<typename Label , typename Left , typename Right >
fcppt::options::flag_name_set fcppt::options::sum< Label, Left, Right >::flag_names ( ) const

◆ operator=() [1/2]

template<typename Label , typename Left , typename Right >
sum& fcppt::options::sum< Label, Left, Right >::operator= ( sum< Label, Left, Right > const &  )

◆ operator=() [2/2]

template<typename Label , typename Left , typename Right >
sum& fcppt::options::sum< Label, Left, Right >::operator= ( sum< Label, Left, Right > &&  )

◆ option_names()

template<typename Label , typename Left , typename Right >
fcppt::options::option_name_set fcppt::options::sum< Label, Left, Right >::option_names ( ) const

◆ parse()

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

◆ usage()

template<typename Label , typename Left , typename Right >
fcppt::string fcppt::options::sum< Label, Left, Right >::usage ( ) const