#include <clara.hpp>
Definition at line 960 of file clara.hpp.
◆ Opt() [1/4]
template<typename LambdaT >
Catch::clara::detail::Opt::Opt |
( |
LambdaT const & | ref | ) |
|
|
inlineexplicit |
Definition at line 966 of file clara.hpp.
966:
ParserRefImpl( std::make_shared<BoundFlagLambda<LambdaT>>( ref ) ) {}
ParserRefImpl(std::shared_ptr< BoundRef > const &ref)
◆ Opt() [2/4]
Catch::clara::detail::Opt::Opt |
( |
bool & | ref | ) |
|
|
inlineexplicit |
◆ Opt() [3/4]
template<typename LambdaT >
Catch::clara::detail::Opt::Opt |
( |
LambdaT const & | ref, |
|
|
std::string const & | hint ) |
|
inline |
Definition at line 971 of file clara.hpp.
auto hint() const -> std::string
◆ Opt() [4/4]
Catch::clara::detail::Opt::Opt |
( |
T & | ref, |
|
|
std::string const & | hint ) |
|
inline |
◆ getHelpColumns()
auto Catch::clara::detail::Opt::getHelpColumns |
( |
| ) |
const -> std::vector<HelpColumns> |
|
inline |
Definition at line 981 of file clara.hpp.
981 {
982 std::ostringstream oss;
983 bool first = true;
985 if (first)
986 first = false;
987 else
988 oss << ", ";
989 oss << opt;
990 }
992 oss <<
" <" <<
m_hint <<
">";
994 }
std::vector< std::string > m_optNames
std::string m_description
◆ isMatch()
auto Catch::clara::detail::Opt::isMatch |
( |
std::string const & | optToken | ) |
const -> bool |
|
inline |
Definition at line 996 of file clara.hpp.
996 {
1000 return true;
1001 }
1002 return false;
1003 }
auto normaliseOpt(std::string const &optName) -> std::string
◆ operator[]()
auto Catch::clara::detail::Opt::operator[] |
( |
std::string const & | optName | ) |
-> Opt & |
|
inline |
Definition at line 976 of file clara.hpp.
976 {
978 return *this;
979 }
◆ parse() [1/2]
Definition at line 816 of file clara.hpp.
816 {
817 return parse( args.exeName(), TokenStream( args ) );
818 }
auto parse(std::string const &, TokenStream const &tokens) const -> InternalParseResult override
◆ parse() [2/2]
Implements Catch::clara::detail::ParserBase.
Definition at line 1007 of file clara.hpp.
1007 {
1008 auto validationResult =
validate();
1009 if( !validationResult )
1011
1012 auto remainingTokens = tokens;
1014 auto const &token = *remainingTokens;
1016 if(
m_ref->isFlag() ) {
1017 auto flagRef =
static_cast<detail::BoundFlagRefBase*
>(
m_ref.get() );
1018 auto result = flagRef->setFlag( true );
1019 if( !result )
1023 } else {
1024 auto valueRef =
static_cast<detail::BoundValueRefBase*
>(
m_ref.get() );
1025 ++remainingTokens;
1026 if( !remainingTokens )
1028 auto const &argToken = *remainingTokens;
1031 auto result = valueRef->setValue( argToken.token );
1032 if( !result )
1036 }
1038 }
1039 }
1041 }
static auto runtimeError(std::string const &message) -> BasicResult
static auto ok() -> BasicResult
auto isMatch(std::string const &optToken) const -> bool
auto validate() const -> Result override
std::shared_ptr< BoundRef > m_ref
BasicResult< ParseState > InternalParseResult
◆ validate()
auto Catch::clara::detail::Opt::validate |
( |
| ) |
const -> Result |
|
inlineoverridevirtual |
Reimplemented from Catch::clara::detail::ParserBase.
Definition at line 1043 of file clara.hpp.
1043 {
1049#ifdef CATCH_PLATFORM_WINDOWS
1050 if(
name[0] !=
'-' &&
name[0] !=
'/' )
1052#else
1053 if(
name[0] !=
'-' )
1055#endif
1056 }
1058 }
static auto logicError(std::string const &message) -> BasicResult
virtual auto validate() const -> Result
◆ m_optNames
std::vector<std::string> Catch::clara::detail::Opt::m_optNames |
|
protected |
The documentation for this class was generated from the following file:
- libraries/sys-vm/external/Catch2/include/external/clara.hpp