MCPcopy Create free account
hub / github.com/Profactor/cv-plot / loadBuffer

Method loadBuffer

CvPlot/ext/catch2/inc/catch.hpp:8785–8814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8783 std::vector<Token> m_tokenBuffer;
8784
8785 void loadBuffer() {
8786 m_tokenBuffer.resize( 0 );
8787
8788 // Skip any empty strings
8789 while( it != itEnd && it->empty() )
8790 ++it;
8791
8792 if( it != itEnd ) {
8793 auto const &next = *it;
8794 if( isOptPrefix( next[0] ) ) {
8795 auto delimiterPos = next.find_first_of( " :=" );
8796 if( delimiterPos != std::string::npos ) {
8797 m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } );
8798 m_tokenBuffer.push_back( { TokenType::Argument, next.substr( delimiterPos + 1 ) } );
8799 } else {
8800 if( next[1] != '-' && next.size() > 2 ) {
8801 std::string opt = "- ";
8802 for( size_t i = 1; i < next.size(); ++i ) {
8803 opt[1] = next[i];
8804 m_tokenBuffer.push_back( { TokenType::Option, opt } );
8805 }
8806 } else {
8807 m_tokenBuffer.push_back( { TokenType::Option, next } );
8808 }
8809 }
8810 } else {
8811 m_tokenBuffer.push_back( { TokenType::Argument, next } );
8812 }
8813 }
8814 }
8815
8816 public:
8817 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