MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / loadBuffer

Method loadBuffer

extlibs/catch/include/catch/catch.hpp:8552–8581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8550 std::vector<Token> m_tokenBuffer;
8551
8552 void loadBuffer() {
8553 m_tokenBuffer.resize( 0 );
8554
8555 // Skip any empty strings
8556 while( it != itEnd && it->empty() )
8557 ++it;
8558
8559 if( it != itEnd ) {
8560 auto const &next = *it;
8561 if( isOptPrefix( next[0] ) ) {
8562 auto delimiterPos = next.find_first_of( " :=" );
8563 if( delimiterPos != std::string::npos ) {
8564 m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } );
8565 m_tokenBuffer.push_back( { TokenType::Argument, next.substr( delimiterPos + 1 ) } );
8566 } else {
8567 if( next[1] != '-' && next.size() > 2 ) {
8568 std::string opt = "- ";
8569 for( size_t i = 1; i < next.size(); ++i ) {
8570 opt[1] = next[i];
8571 m_tokenBuffer.push_back( { TokenType::Option, opt } );
8572 }
8573 } else {
8574 m_tokenBuffer.push_back( { TokenType::Option, next } );
8575 }
8576 }
8577 } else {
8578 m_tokenBuffer.push_back( { TokenType::Argument, next } );
8579 }
8580 }
8581 }
8582
8583 public:
8584 explicit TokenStream( Args const &args ) : TokenStream( args.m_args.begin(), args.m_args.end() ) {}

Callers

nothing calls this directly

Calls 6

isOptPrefixFunction · 0.85
resizeMethod · 0.80
substrMethod · 0.80
emptyMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected