MCPcopy Create free account
hub / github.com/Snapchat/Valdi / needsUnicodeEscaping

Function needsUnicodeEscaping

valdi_core/src/valdi_core/cpp/Utils/JSONWriter.cpp:16–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace Valdi {
15
16static bool needsUnicodeEscaping(std::string_view str) {
17 const auto* it = reinterpret_cast<const Byte*>(str.data());
18 const auto* end = it + str.size();
19
20 while (it != end) {
21 auto c = *it;
22 if (c >= 0x7f) {
23 return true;
24 }
25 it++;
26 }
27
28 return false;
29}
30
31JSONWriter::JSONWriter(ByteBuffer& output) : _output(output) {}
32

Callers 1

writeStringMethod · 0.85

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected