26      unsigned _splitSimple( std::string_view line_r, 
const WordConsumer& fnc_r )
 
   32        const char *
const eol = line_r.data() + line_r.size();  
 
   33        const char * searchfrom = line_r.data();        
 
   36        auto isSep = []( 
char ch )->
bool { 
return ch == 
' '|| ch == 
'\t'; };
 
   38        auto skipSep = [eol,&isSep]( 
const char *& ptr )->
bool {
 
   39          while ( ptr < eol && isSep( *ptr ) )
 
   44        auto skipWord = [eol,&isSep]( 
const char *& ptr )->
void {
 
   45          while ( ptr < eol && ! isSep( *ptr ) )
 
   51        std::string_view word;
 
   53        while ( skipSep( searchfrom ) ) {
 
   54          const char * wordstart = searchfrom;
 
   56          if ( ! word.empty() ) {
 
   58              if ( ! fnc_r( word, fncCall, 
false ) ) {
 
   61                const char * wordend = eol;
 
   62                while ( isSep( *(wordend-1) ) ) 
 
   64                word = std::string_view( wordstart, wordend-wordstart );
 
   73          skipWord( searchfrom );
 
   74          word = std::string_view( wordstart, searchfrom-wordstart );
 
   78        if ( ! word.empty() ) {
 
   80            fnc_r( word, fncCall, 
true );
 
 
 
   89    unsigned detail::_split( std::string_view line_r, std::string_view sep_r, Trim trim_r, WordConsumer && fnc_r )
 
   92        return _splitSimple( line_r, std::move( fnc_r ) );
 
   98      using size_type = std::string_view::size_type;
 
   99      size_type wordstart = 0;  
 
  100      size_type searchfrom = 0; 
 
  103        searchfrom = line_r.find( sep_r, searchfrom );
 
  104        if ( fncStop || searchfrom == line_r.npos ) {
 
  110          if ( ! fnc_r( trim( line_r.substr(wordstart,searchfrom-wordstart), trim_r ), fncCall, 
false ) )
 
  116        searchfrom += sep_r.size();
 
  117        wordstart = searchfrom;
 
  118      } 
while( wordstart < line_r.size() );
 
  122        if ( wordstart < line_r.size() )
 
  123          fnc_r( 
trim( line_r.substr(wordstart,line_r.size()-wordstart), trim_r ), fncCall, 
true );
 
  125          fnc_r( std::string_view( line_r.data()+line_r.size(), 0 ), fncCall, 
true );
 
  131    unsigned detail::_splitRx( std::string_view line_r, 
const regex & rx_r, 
const WordConsumer& fnc_r )
 
  134      bool fncStop = 
false;
 
  135      unsigned fncCall = 0;
 
  138      const char *
const eol = line_r.data() + line_r.size();    
 
  139      bool trailingNL = line_r.size() && *(eol-1) == 
'\n';      
 
  140      const char * wordstart = line_r.data();   
 
  141      const char * searchfrom = line_r.data();  
 
  144      auto matchAtBOL = [&]() {
 
  145        return searchfrom == line_r.data() || *(searchfrom-1) == 
'\n' ? regex::none : regex::not_bol;
 
  149        if ( fncStop || ! rx_r.matches( searchfrom, match, matchAtBOL() ) ) {
 
  152        if ( trailingNL && searchfrom+match.begin(0) == eol )
 
  155        if ( match.end(0) == 0 && searchfrom == wordstart && searchfrom != line_r.data() ) {
 
  164            if ( ! fnc_r( std::string_view( wordstart, searchfrom+match.begin(0) - wordstart ), fncCall, 
false ) )
 
  170          wordstart = searchfrom+match.end(0);
 
  171          searchfrom += match.end(0) ? match.end(0) : 1;
 
  173      } 
while ( searchfrom <= eol );    
 
  177        if ( wordstart < eol )
 
  178          fnc_r( std::string_view( wordstart, eol-wordstart ), fncCall, 
true );
 
  180          fnc_r( std::string_view( eol, 0 ), fncCall, 
true );