Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::clara::detail::ParserRefImpl< DerivedT > Class Template Reference

#include <clara.hpp>

Inheritance diagram for Catch::clara::detail::ParserRefImpl< DerivedT >:
Collaboration diagram for Catch::clara::detail::ParserRefImpl< DerivedT >:

Public Member Functions

template<typename T >
 ParserRefImpl (T &ref, std::string const &hint)
 
template<typename LambdaT >
 ParserRefImpl (LambdaT const &ref, std::string const &hint)
 
auto operator() (std::string const &description) -> DerivedT &
 
auto optional () -> DerivedT &
 
auto required () -> DerivedT &
 
auto isOptional () const -> bool
 
auto cardinality () const -> size_t override
 
auto hint () const -> std::string
 
- Public Member Functions inherited from Catch::clara::detail::ComposableParserImpl< DerivedT >
template<typename T >
auto operator| (T const &other) const -> Parser
 
template<typename T >
auto operator+ (T const &other) const -> Parser
 
- Public Member Functions inherited from Catch::clara::detail::ParserBase
virtual ~ParserBase ()=default
 
virtual auto validate () const -> Result
 
virtual auto parse (std::string const &exeName, TokenStream const &tokens) const -> InternalParseResult=0
 
auto parse (Args const &args) const -> InternalParseResult
 

Protected Member Functions

 ParserRefImpl (std::shared_ptr< BoundRef > const &ref)
 

Protected Attributes

Optionality m_optionality = Optionality::Optional
 
std::shared_ptr< BoundRefm_ref
 
std::string m_hint
 
std::string m_description
 

Detailed Description

template<typename DerivedT>
class Catch::clara::detail::ParserRefImpl< DerivedT >

Definition at line 833 of file clara.hpp.

Constructor & Destructor Documentation

◆ ParserRefImpl() [1/3]

template<typename DerivedT >
Catch::clara::detail::ParserRefImpl< DerivedT >::ParserRefImpl ( std::shared_ptr< BoundRef > const & ref)
inlineexplicitprotected

Definition at line 840 of file clara.hpp.

840: m_ref( ref ) {}
std::shared_ptr< BoundRef > m_ref
Definition clara.hpp:836

◆ ParserRefImpl() [2/3]

template<typename DerivedT >
template<typename T >
Catch::clara::detail::ParserRefImpl< DerivedT >::ParserRefImpl ( T & ref,
std::string const & hint )
inline

Definition at line 844 of file clara.hpp.

845 : m_ref( std::make_shared<BoundValueRef<T>>( ref ) ),
846 m_hint( hint )
847 {}
auto hint() const -> std::string
Definition clara.hpp:881

◆ ParserRefImpl() [3/3]

template<typename DerivedT >
template<typename LambdaT >
Catch::clara::detail::ParserRefImpl< DerivedT >::ParserRefImpl ( LambdaT const & ref,
std::string const & hint )
inline

Definition at line 850 of file clara.hpp.

851 : m_ref( std::make_shared<BoundLambda<LambdaT>>( ref ) ),
852 m_hint(hint)
853 {}

Member Function Documentation

◆ cardinality()

template<typename DerivedT >
auto Catch::clara::detail::ParserRefImpl< DerivedT >::cardinality ( ) const -> size_t
inlineoverridevirtual

Reimplemented from Catch::clara::detail::ParserBase.

Definition at line 874 of file clara.hpp.

874 {
875 if( m_ref->isContainer() )
876 return 0;
877 else
878 return 1;
879 }

◆ hint()

template<typename DerivedT >
auto Catch::clara::detail::ParserRefImpl< DerivedT >::hint ( ) const -> std::string
inline

Definition at line 881 of file clara.hpp.

881{ return m_hint; }

◆ isOptional()

template<typename DerivedT >
auto Catch::clara::detail::ParserRefImpl< DerivedT >::isOptional ( ) const -> bool
inline

Definition at line 870 of file clara.hpp.

◆ operator()()

template<typename DerivedT >
auto Catch::clara::detail::ParserRefImpl< DerivedT >::operator() ( std::string const & description) -> DerivedT &
inline

Definition at line 855 of file clara.hpp.

855 {
856 m_description = description;
857 return static_cast<DerivedT &>( *this );
858 }

◆ optional()

template<typename DerivedT >
auto Catch::clara::detail::ParserRefImpl< DerivedT >::optional ( ) -> DerivedT &
inline

Definition at line 860 of file clara.hpp.

860 {
862 return static_cast<DerivedT &>( *this );
863 };

◆ required()

template<typename DerivedT >
auto Catch::clara::detail::ParserRefImpl< DerivedT >::required ( ) -> DerivedT &
inline

Definition at line 865 of file clara.hpp.

865 {
867 return static_cast<DerivedT &>( *this );
868 };

Member Data Documentation

◆ m_description

template<typename DerivedT >
std::string Catch::clara::detail::ParserRefImpl< DerivedT >::m_description
protected

Definition at line 838 of file clara.hpp.

◆ m_hint

template<typename DerivedT >
std::string Catch::clara::detail::ParserRefImpl< DerivedT >::m_hint
protected

Definition at line 837 of file clara.hpp.

◆ m_optionality

template<typename DerivedT >
Optionality Catch::clara::detail::ParserRefImpl< DerivedT >::m_optionality = Optionality::Optional
protected

Definition at line 835 of file clara.hpp.

◆ m_ref

template<typename DerivedT >
std::shared_ptr<BoundRef> Catch::clara::detail::ParserRefImpl< DerivedT >::m_ref
protected

Definition at line 836 of file clara.hpp.


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