Write the character ch as a JSON escape sequence ("\u00xx")
| 422 | |
| 423 | // Write the character ch as a JSON escape sequence ("\u00xx") |
| 424 | uint32_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. |
| 435 | uint32_t TJSONProtocol::writeJSONChar(uint8_t ch) { |