MCPcopy Create free account
hub / github.com/SpartanJ/eepp / searchSubstr

Function searchSubstr

src/eepp/ui/doc/textdocument.cpp:426–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424}
425
426static 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
447static String ptrGetLine( char* data, const size_t& size, size_t& position,
448 TextFormat::Encoding enc ) {

Callers 1

ptrGetLineFunction · 0.85

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected