MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Arg

Class Arg

Source/ThirdParty/catch2/catch.hpp:9335–9358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9333 };
9334
9335 class Arg : public ParserRefImpl<Arg> {
9336 public:
9337 using ParserRefImpl::ParserRefImpl;
9338
9339 auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override {
9340 auto validationResult = validate();
9341 if( !validationResult )
9342 return InternalParseResult( validationResult );
9343
9344 auto remainingTokens = tokens;
9345 auto const &token = *remainingTokens;
9346 if( token.type != TokenType::Argument )
9347 return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
9348
9349 assert( !m_ref->isFlag() );
9350 auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
9351
9352 auto result = valueRef->setValue( remainingTokens->token );
9353 if( !result )
9354 return InternalParseResult( result );
9355 else
9356 return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
9357 }
9358 };
9359
9360 inline auto normaliseOpt( std::string const &optName ) -> std::string {
9361#ifdef CATCH_PLATFORM_WINDOWS

Callers 1

makeCommandLineParserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected