| 3835 | } |
| 3836 | |
| 3837 | bool Value::isUInt64() const { |
| 3838 | #if defined(JSON_HAS_INT64) |
| 3839 | switch (type_) { |
| 3840 | case intValue: |
| 3841 | return value_.int_ >= 0; |
| 3842 | case uintValue: |
| 3843 | return true; |
| 3844 | case realValue: |
| 3845 | // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a |
| 3846 | // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we |
| 3847 | // require the value to be strictly less than the limit. |
| 3848 | return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble && |
| 3849 | IsIntegral(value_.real_); |
| 3850 | default: |
| 3851 | break; |
| 3852 | } |
| 3853 | #endif // JSON_HAS_INT64 |
| 3854 | return false; |
| 3855 | } |
| 3856 | |
| 3857 | bool Value::isIntegral() const { |
| 3858 | switch (type_) { |
nothing calls this directly
no test coverage detected