MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / isAsciiUtf16Buffer

Function isAsciiUtf16Buffer

src/cpp/encoding/Encodings.cpp:425–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423 }
424
425 bool isAsciiUtf16Buffer(const View<uint8_t>& buffer)
426 {
427 auto i = int64_t{ 0 };
428 while (i < buffer.length)
429 {
430 auto p = cpp::encoding::Utf16::codepoint(buffer.slice(i));
431
432 if (p > 127)
433 {
434 return false;
435 }
436
437 i += cpp::encoding::Utf16::getByteCount(p);
438 }
439
440 return true;
441 }
442
443 String toAsciiString(const View<uint8_t>& buffer)
444 {

Callers

nothing calls this directly

Calls 2

getByteCountFunction · 0.50
sliceMethod · 0.45

Tested by

no test coverage detected