| 1321 | } |
| 1322 | |
| 1323 | bool Value::isUInt64() const { |
| 1324 | #if defined(JSON_HAS_INT64) |
| 1325 | switch (type()) { |
| 1326 | case intValue: |
| 1327 | return value_.int_ >= 0; |
| 1328 | case uintValue: |
| 1329 | return true; |
| 1330 | case realValue: |
| 1331 | // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a |
| 1332 | // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we |
| 1333 | // require the value to be strictly less than the limit. |
| 1334 | return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble && |
| 1335 | IsIntegral(value_.real_); |
| 1336 | default: |
| 1337 | break; |
| 1338 | } |
| 1339 | #endif // JSON_HAS_INT64 |
| 1340 | return false; |
| 1341 | } |
| 1342 | |
| 1343 | bool Value::isIntegral() const { |
| 1344 | switch (type()) { |
nothing calls this directly
no test coverage detected