| 1507 | } |
| 1508 | |
| 1509 | bool Value::isUInt64() const { |
| 1510 | #if defined(JSON_HAS_INT64) |
| 1511 | switch (type()) { |
| 1512 | case intValue: |
| 1513 | return value_.int_ >= 0; |
| 1514 | case uintValue: |
| 1515 | return true; |
| 1516 | case realValue: |
| 1517 | // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a |
| 1518 | // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we |
| 1519 | // require the value to be strictly less than the limit. |
| 1520 | return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_); |
| 1521 | default: |
| 1522 | break; |
| 1523 | } |
| 1524 | #endif // JSON_HAS_INT64 |
| 1525 | return false; |
| 1526 | } |
| 1527 | |
| 1528 | bool Value::isIntegral() const { |
| 1529 | switch (type()) { |
nothing calls this directly
no test coverage detected