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

Method readJSONEscapeChar

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

Decodes the four hex parts of a JSON escaped string character and returns the UTF-16 code unit via out.

Source from the content-addressed store, hash-verified

732// Decodes the four hex parts of a JSON escaped string character and returns
733// the UTF-16 code unit via out.
734uint32_t TJSONProtocol::readJSONEscapeChar(uint16_t* out) {
735 uint8_t b[4];
736 b[0] = reader_.read();
737 b[1] = reader_.read();
738 b[2] = reader_.read();
739 b[3] = reader_.read();
740
741 *out = (hexVal(b[0]) << 12)
742 + (hexVal(b[1]) << 8) + (hexVal(b[2]) << 4) + hexVal(b[3]);
743
744 return 4;
745}
746
747// Decodes a JSON string, including unescaping, and returns the string via str
748uint32_t TJSONProtocol::readJSONString(std::string& str, bool skipContext) {

Callers

nothing calls this directly

Calls 2

hexValFunction · 0.85
readMethod · 0.65

Tested by

no test coverage detected