MCPcopy Create free account
hub / github.com/apache/thrift / handleOpt

Method handleOpt

compiler/cpp/tests/catch/catch.hpp:4642–4655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4640 }
4641
4642 Mode handleOpt( std::size_t i, char c, std::string const& arg, std::vector<Token>& tokens ) {
4643 if( std::string( ":=\0", 3 ).find( c ) == std::string::npos )
4644 return mode;
4645
4646 std::string optName = arg.substr( from, i-from );
4647 if( mode == ShortOpt )
4648 for( std::size_t j = 0; j < optName.size(); ++j )
4649 tokens.push_back( Token( Token::ShortOpt, optName.substr( j, 1 ) ) );
4650 else if( mode == SlashOpt && optName.size() == 1 )
4651 tokens.push_back( Token( Token::ShortOpt, optName ) );
4652 else
4653 tokens.push_back( Token( Token::LongOpt, optName ) );
4654 return None;
4655 }
4656 Mode handlePositional( std::size_t i, char c, std::string const& arg, std::vector<Token>& tokens ) {
4657 if( inQuotes || std::string( "\0", 1 ).find( c ) == std::string::npos )
4658 return mode;

Callers

nothing calls this directly

Calls 5

stringFunction · 0.85
TokenClass · 0.85
findMethod · 0.80
substrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected