| 198 | } |
| 199 | |
| 200 | int64_t Json::toInt() const { |
| 201 | if (type() == Type::Float) { |
| 202 | return (int64_t)m_data.get<double>(); |
| 203 | } else if (type() == Type::Int) { |
| 204 | return m_data.get<int64_t>(); |
| 205 | } else { |
| 206 | throw JsonException::format("Improper conversion to int from {}", typeName()); |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | uint64_t Json::toUInt() const { |
| 211 | if (type() == Type::Float) { |
no test coverage detected