MCPcopy Create free account
hub / github.com/arangodb/velocypack / JSONStringCopyCheckUtf8C

Function JSONStringCopyCheckUtf8C

src/asm-functions.cpp:50–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50inline std::size_t JSONStringCopyCheckUtf8C(uint8_t* dst, uint8_t const* src, std::size_t limit) {
51 // Copy up to limit uint8_t from src to dst.
52 // Stop at the first control character or backslash or double quote.
53 // Also stop at byte with high bit set.
54 // Report the number of bytes copied. May copy less bytes, for example
55 // for alignment reasons.
56 uint8_t const* end = src + limit;
57 while (src < end && *src >= 32 && *src != '\\' && *src != '"' &&
58 *src < 0x80) {
59 *dst++ = *src++;
60 }
61 return limit - (end - src);
62}
63
64inline std::size_t JSONSkipWhiteSpaceC(uint8_t const* src, std::size_t limit) {
65 // Skip up to limit uint8_t from src as long as they are whitespace.

Callers 1

doInitCopyCheckUtf8Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected