MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/TriangleMeshDistance / loadBuffer

Method loadBuffer

tests/catch.hpp:6758–6787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6756 std::vector<Token> m_tokenBuffer;
6757
6758 void loadBuffer() {
6759 m_tokenBuffer.resize( 0 );
6760
6761 // Skip any empty strings
6762 while( it != itEnd && it->empty() )
6763 ++it;
6764
6765 if( it != itEnd ) {
6766 auto const &next = *it;
6767 if( isOptPrefix( next[0] ) ) {
6768 auto delimiterPos = next.find_first_of( " :=" );
6769 if( delimiterPos != std::string::npos ) {
6770 m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } );
6771 m_tokenBuffer.push_back( { TokenType::Argument, next.substr( delimiterPos + 1 ) } );
6772 } else {
6773 if( next[1] != '-' && next.size() > 2 ) {
6774 std::string opt = "- ";
6775 for( size_t i = 1; i < next.size(); ++i ) {
6776 opt[1] = next[i];
6777 m_tokenBuffer.push_back( { TokenType::Option, opt } );
6778 }
6779 } else {
6780 m_tokenBuffer.push_back( { TokenType::Option, next } );
6781 }
6782 }
6783 } else {
6784 m_tokenBuffer.push_back( { TokenType::Argument, next } );
6785 }
6786 }
6787 }
6788
6789 public:
6790 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