MCPcopy Create free account
hub / github.com/VCVRack/Rack / UTF8CodepointPos

Function UTF8CodepointPos

src/string.cpp:529–541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527
528
529size_t UTF8CodepointPos(const std::string& s8, size_t endIndex) {
530 size_t pos = 0;
531 size_t index = 0;
532 while (index < endIndex && pos < s8.size()) {
533 size_t newPos = UTF8NextCodepoint(s8, pos);
534 // Check if codepoint is invalid
535 if (pos == newPos)
536 return pos;
537 pos = newPos;
538 index++;
539 }
540 return pos;
541}
542
543
544#if defined ARCH_WIN

Callers

nothing calls this directly

Calls 2

UTF8NextCodepointFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected