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

Method readFieldBegin

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

Source from the content-addressed store, hash-verified

985}
986
987uint32_t TJSONProtocol::readFieldBegin(std::string& name, TType& fieldType, int16_t& fieldId) {
988 (void)name;
989 uint32_t result = 0;
990 // Check if we hit the end of the list
991 uint8_t ch = reader_.peek();
992 if (ch == kJSONObjectEnd) {
993 fieldType = apache::thrift::protocol::T_STOP;
994 } else {
995 uint64_t tmpVal = 0;
996 std::string tmpStr;
997 result += readJSONInteger(tmpVal);
998 if (tmpVal > static_cast<uint32_t>((std::numeric_limits<int16_t>::max)()))
999 throw TProtocolException(TProtocolException::SIZE_LIMIT);
1000 fieldId = static_cast<int16_t>(tmpVal);
1001 result += readJSONObjectStart();
1002 result += readJSONString(tmpStr);
1003 fieldType = getTypeIDForTypeName(tmpStr);
1004 }
1005 return result;
1006}
1007
1008uint32_t TJSONProtocol::readFieldEnd() {
1009 return readJSONObjectEnd();

Callers

nothing calls this directly

Calls 3

getTypeIDForTypeNameFunction · 0.85
TProtocolExceptionClass · 0.70
peekMethod · 0.45

Tested by

no test coverage detected