MCPcopy Create free account
hub / github.com/SOCI/soci / splitStringRef

Function splitStringRef

tests/catch.hpp:13876–13889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13874 }
13875
13876 std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) {
13877 std::vector<StringRef> subStrings;
13878 std::size_t start = 0;
13879 for(std::size_t pos = 0; pos < str.size(); ++pos ) {
13880 if( str[pos] == delimiter ) {
13881 if( pos - start > 1 )
13882 subStrings.push_back( str.substr( start, pos-start ) );
13883 start = pos+1;
13884 }
13885 }
13886 if( start < str.size() )
13887 subStrings.push_back( str.substr( start, str.size()-start ) );
13888 return subStrings;
13889 }
13890
13891 pluralise::pluralise( std::size_t count, std::string const& label )
13892 : m_count( count ),

Callers 1

parseEnumsFunction · 0.85

Calls 2

substrMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected