Read 1 character from the transport trans and verify that it is the expected character ch. Throw a protocol exception if it is not.
| 233 | // expected character ch. |
| 234 | // Throw a protocol exception if it is not. |
| 235 | static uint32_t readSyntaxChar(TJSONProtocol::LookaheadReader& reader, uint8_t ch) { |
| 236 | uint8_t ch2 = reader.read(); |
| 237 | if (ch2 != ch) { |
| 238 | throw TProtocolException(TProtocolException::INVALID_DATA, |
| 239 | "Expected \'" + std::string((char*)&ch, 1) + "\'; got \'" |
| 240 | + std::string((char*)&ch2, 1) + "\'."); |
| 241 | } |
| 242 | return 1; |
| 243 | } |
| 244 | |
| 245 | // Return the integer value of a hex character ch. |
| 246 | // Throw a protocol exception if the character is not [0-9a-f]. |
no test coverage detected