readByte() must be handled properly because boost::lexical cast sees int8_t as a text type instead of an integer type
| 1084 | // readByte() must be handled properly because boost::lexical cast sees int8_t |
| 1085 | // as a text type instead of an integer type |
| 1086 | uint32_t TJSONProtocol::readByte(int8_t& byte) { |
| 1087 | auto tmp = (int16_t)byte; |
| 1088 | uint32_t result = readJSONInteger(tmp); |
| 1089 | if (tmp > 127 || tmp < -128) { |
| 1090 | throw TProtocolException(TProtocolException::INVALID_DATA, |
| 1091 | "Expected byte value; got " + to_string(tmp)); |
| 1092 | } |
| 1093 | byte = (int8_t)tmp; |
| 1094 | return result; |
| 1095 | } |
| 1096 | |
| 1097 | uint32_t TJSONProtocol::readI16(int16_t& i16) { |
| 1098 | return readJSONInteger(i16); |
nothing calls this directly
no test coverage detected