| 865 | // returning them via num |
| 866 | template <typename NumberType> |
| 867 | uint32_t TJSONProtocol::readJSONInteger(NumberType& num) { |
| 868 | uint32_t result = context_->read(reader_); |
| 869 | if (context_->escapeNum()) { |
| 870 | result += readJSONSyntaxChar(kJSONStringDelimiter); |
| 871 | } |
| 872 | std::string str; |
| 873 | result += readJSONNumericChars(str); |
| 874 | try { |
| 875 | num = fromString<NumberType>(str); |
| 876 | } catch (const std::runtime_error&) { |
| 877 | throw TProtocolException(TProtocolException::INVALID_DATA, |
| 878 | "Expected numeric value; got \"" + str + "\""); |
| 879 | } |
| 880 | if (context_->escapeNum()) { |
| 881 | result += readJSONSyntaxChar(kJSONStringDelimiter); |
| 882 | } |
| 883 | return result; |
| 884 | } |
| 885 | |
| 886 | // Reads a JSON number or string and interprets it as a double. |
| 887 | uint32_t TJSONProtocol::readJSONDouble(double& num) { |
nothing calls this directly
no test coverage detected