MCPcopy Create free account
hub / github.com/RenderKit/embree / loadBuffer

Method loadBuffer

tutorials/external/catch.hpp:6977–7006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6975 std::vector<Token> m_tokenBuffer;
6976
6977 void loadBuffer() {
6978 m_tokenBuffer.resize( 0 );
6979
6980 // Skip any empty strings
6981 while( it != itEnd && it->empty() )
6982 ++it;
6983
6984 if( it != itEnd ) {
6985 auto const &next = *it;
6986 if( isOptPrefix( next[0] ) ) {
6987 auto delimiterPos = next.find_first_of( " :=" );
6988 if( delimiterPos != std::string::npos ) {
6989 m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } );
6990 m_tokenBuffer.push_back( { TokenType::Argument, next.substr( delimiterPos + 1 ) } );
6991 } else {
6992 if( next[1] != '-' && next.size() > 2 ) {
6993 std::string opt = "- ";
6994 for( size_t i = 1; i < next.size(); ++i ) {
6995 opt[1] = next[i];
6996 m_tokenBuffer.push_back( { TokenType::Option, opt } );
6997 }
6998 } else {
6999 m_tokenBuffer.push_back( { TokenType::Option, next } );
7000 }
7001 }
7002 } else {
7003 m_tokenBuffer.push_back( { TokenType::Argument, next } );
7004 }
7005 }
7006 }
7007
7008 public:
7009 explicit TokenStream( Args const &args ) : TokenStream( args.m_args.begin(), args.m_args.end() ) {}

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected