MCPcopy Create free account
hub / github.com/apache/thrift / writeJSONEscapeChar

Method writeJSONEscapeChar

lib/cpp/src/thrift/protocol/TJSONProtocol.cpp:424–432  ·  view source on GitHub ↗

Write the character ch as a JSON escape sequence ("\u00xx")

Source from the content-addressed store, hash-verified

422
423// Write the character ch as a JSON escape sequence ("\u00xx")
424uint32_t TJSONProtocol::writeJSONEscapeChar(uint8_t ch) {
425 trans_->write((const uint8_t*)kJSONEscapePrefix.c_str(),
426 static_cast<uint32_t>(kJSONEscapePrefix.length()));
427 uint8_t outCh = hexChar(ch >> 4);
428 trans_->write(&outCh, 1);
429 outCh = hexChar(ch);
430 trans_->write(&outCh, 1);
431 return 6;
432}
433
434// Write the character ch as part of a JSON string, escaping as appropriate.
435uint32_t TJSONProtocol::writeJSONChar(uint8_t ch) {

Callers

nothing calls this directly

Calls 3

hexCharFunction · 0.85
writeMethod · 0.65
lengthMethod · 0.65

Tested by

no test coverage detected