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

Function readSyntaxChar

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

Read 1 character from the transport trans and verify that it is the expected character ch. Throw a protocol exception if it is not.

Source from the content-addressed store, hash-verified

233// expected character ch.
234// Throw a protocol exception if it is not.
235static 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].

Callers 3

readMethod · 0.85
readMethod · 0.85
readJSONSyntaxCharMethod · 0.85

Calls 3

stringFunction · 0.85
TProtocolExceptionClass · 0.70
readMethod · 0.65

Tested by

no test coverage detected