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

Method loadBuffer

external/catch.hpp:8860–8889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8858 std::vector<Token> m_tokenBuffer;
8859
8860 void loadBuffer() {
8861 m_tokenBuffer.resize( 0 );
8862
8863 // Skip any empty strings
8864 while( it != itEnd && it->empty() )
8865 ++it;
8866
8867 if( it != itEnd ) {
8868 auto const &next = *it;
8869 if( isOptPrefix( next[0] ) ) {
8870 auto delimiterPos = next.find_first_of( " :=" );
8871 if( delimiterPos != std::string::npos ) {
8872 m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } );
8873 m_tokenBuffer.push_back( { TokenType::Argument, next.substr( delimiterPos + 1 ) } );
8874 } else {
8875 if( next[1] != '-' && next.size() > 2 ) {
8876 std::string opt = "- ";
8877 for( size_t i = 1; i < next.size(); ++i ) {
8878 opt[1] = next[i];
8879 m_tokenBuffer.push_back( { TokenType::Option, opt } );
8880 }
8881 } else {
8882 m_tokenBuffer.push_back( { TokenType::Option, next } );
8883 }
8884 }
8885 } else {
8886 m_tokenBuffer.push_back( { TokenType::Argument, next } );
8887 }
8888 }
8889 }
8890
8891 public:
8892 explicit TokenStream( Args const &args ) : TokenStream( args.m_args.begin(), args.m_args.end() ) {}

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected