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

Function splitStringRef

extlibs/catch/include/catch/catch.hpp:13220–13233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13218 }
13219
13220 std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) {
13221 std::vector<StringRef> subStrings;
13222 std::size_t start = 0;
13223 for(std::size_t pos = 0; pos < str.size(); ++pos ) {
13224 if( str[pos] == delimiter ) {
13225 if( pos - start > 1 )
13226 subStrings.push_back( str.substr( start, pos-start ) );
13227 start = pos+1;
13228 }
13229 }
13230 if( start < str.size() )
13231 subStrings.push_back( str.substr( start, str.size()-start ) );
13232 return subStrings;
13233 }
13234
13235 pluralise::pluralise( std::size_t count, std::string const& label )
13236 : m_count( count ),

Callers 1

parseEnumsFunction · 0.85

Calls 3

substrMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected