| 3733 | } |
| 3734 | |
| 3735 | bool Value::isInt64() const { |
| 3736 | #if defined(JSON_HAS_INT64) |
| 3737 | switch (type_) { |
| 3738 | case intValue: |
| 3739 | return true; |
| 3740 | case uintValue: |
| 3741 | return value_.uint_ <= UInt64(maxInt64); |
| 3742 | case realValue: |
| 3743 | // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a |
| 3744 | // double, so double(maxInt64) will be rounded up to 2^63. Therefore we |
| 3745 | // require the value to be strictly less than the limit. |
| 3746 | return value_.real_ >= double(minInt64) && |
| 3747 | value_.real_ < double(maxInt64) && IsIntegral(value_.real_); |
| 3748 | default: |
| 3749 | break; |
| 3750 | } |
| 3751 | #endif // JSON_HAS_INT64 |
| 3752 | return false; |
| 3753 | } |
| 3754 | |
| 3755 | bool Value::isUInt64() const { |
| 3756 | #if defined(JSON_HAS_INT64) |
nothing calls this directly
no test coverage detected