| 2502 | } |
| 2503 | |
| 2504 | size_t String::countLines( std::string_view text ) { |
| 2505 | if ( text.empty() ) |
| 2506 | return 0; |
| 2507 | size_t count = 1; |
| 2508 | for ( const auto& c : text ) |
| 2509 | if ( c == '\n' ) |
| 2510 | count++; |
| 2511 | return count; |
| 2512 | } |
| 2513 | |
| 2514 | void String::readBySeparator( String::View buf, std::function<void( String::View )> onSepChunkRead, |
| 2515 | String::StringBaseType sep ) { |