MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / splitStringRef

Function splitStringRef

test/expected/catch.hpp:13655–13668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13653 }
13654
13655 std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) {
13656 std::vector<StringRef> subStrings;
13657 std::size_t start = 0;
13658 for(std::size_t pos = 0; pos < str.size(); ++pos ) {
13659 if( str[pos] == delimiter ) {
13660 if( pos - start > 1 )
13661 subStrings.push_back( str.substr( start, pos-start ) );
13662 start = pos+1;
13663 }
13664 }
13665 if( start < str.size() )
13666 subStrings.push_back( str.substr( start, str.size()-start ) );
13667 return subStrings;
13668 }
13669
13670 pluralise::pluralise( std::size_t count, std::string const& label )
13671 : m_count( count ),

Callers 1

parseEnumsFunction · 0.85

Calls 2

substrMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected