MCPcopy Create free account
hub / github.com/cinder/Cinder / loadBuffer

Method loadBuffer

test/unit/src/catch.hpp:8871–8900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 9

setupMethod · 0.45
fileDropMethod · 0.45
keyDownMethod · 0.45
setupBufferPlayerNodeMethod · 0.45
openFileMethod · 0.45
testConverterMethod · 0.45
testWriteMethod · 0.45
SpectralTestMethod · 0.45
openFileMethod · 0.45

Calls 6

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

Tested by 6

setupBufferPlayerNodeMethod · 0.36
openFileMethod · 0.36
testConverterMethod · 0.36
testWriteMethod · 0.36
SpectralTestMethod · 0.36
openFileMethod · 0.36