| 3856 | } |
| 3857 | |
| 3858 | bool Value::isUInt64() const { |
| 3859 | #if defined(JSON_HAS_INT64) |
| 3860 | switch (type_) { |
| 3861 | case intValue: |
| 3862 | return value_.int_ >= 0; |
| 3863 | case uintValue: |
| 3864 | return true; |
| 3865 | case realValue: |
| 3866 | // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a |
| 3867 | // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we |
| 3868 | // require the value to be strictly less than the limit. |
| 3869 | return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble && |
| 3870 | IsIntegral(value_.real_); |
| 3871 | default: |
| 3872 | break; |
| 3873 | } |
| 3874 | #endif // JSON_HAS_INT64 |
| 3875 | return false; |
| 3876 | } |
| 3877 | |
| 3878 | bool Value::isIntegral() const { |
| 3879 | switch (type_) { |
nothing calls this directly
no test coverage detected