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

Function splitStringRef

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

Source from the content-addressed store, hash-verified

13635 }
13636
13637 std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) {
13638 std::vector<StringRef> subStrings;
13639 std::size_t start = 0;
13640 for(std::size_t pos = 0; pos < str.size(); ++pos ) {
13641 if( str[pos] == delimiter ) {
13642 if( pos - start > 1 )
13643 subStrings.push_back( str.substr( start, pos-start ) );
13644 start = pos+1;
13645 }
13646 }
13647 if( start < str.size() )
13648 subStrings.push_back( str.substr( start, str.size()-start ) );
13649 return subStrings;
13650 }
13651
13652 pluralise::pluralise( std::size_t count, std::string const& label )
13653 : m_count( count ),

Callers 1

parseEnumsFunction · 0.85

Calls 2

sizeMethod · 0.80
substrMethod · 0.80

Tested by

no test coverage detected