| 424 | } |
| 425 | |
| 426 | static inline void searchSubstr( char* data, const size_t& size, size_t& position, |
| 427 | const std::string_view& substr, const std::string_view& substrfb, |
| 428 | int codepointSize ) { |
| 429 | position = 0; |
| 430 | const char* found = |
| 431 | std::search( data, data + size, substr.data(), substr.data() + substr.size() ); |
| 432 | if ( found != data + size ) { |
| 433 | position = ( found - data ); |
| 434 | position += codepointSize; |
| 435 | } else { |
| 436 | found = |
| 437 | std::search( data, data + size, substrfb.data(), substrfb.data() + substrfb.size() ); |
| 438 | if ( found != data + size ) { |
| 439 | position = ( found - data ); |
| 440 | position += codepointSize; |
| 441 | } else { |
| 442 | position = size; |
| 443 | } |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | static String ptrGetLine( char* data, const size_t& size, size_t& position, |
| 448 | TextFormat::Encoding enc ) { |
no test coverage detected