| 2193 | } |
| 2194 | |
| 2195 | bool Value::asBool() const { |
| 2196 | switch (type_) { |
| 2197 | case booleanValue: |
| 2198 | return value_.bool_; |
| 2199 | case nullValue: |
| 2200 | return false; |
| 2201 | case intValue: |
| 2202 | return value_.int_ ? true : false; |
| 2203 | case uintValue: |
| 2204 | return value_.uint_ ? true : false; |
| 2205 | case realValue: |
| 2206 | return value_.real_ ? true : false; |
| 2207 | default: |
| 2208 | break; |
| 2209 | } |
| 2210 | JSON_FAIL_MESSAGE("Value is not convertible to bool."); |
| 2211 | } |
| 2212 | |
| 2213 | bool Value::isConvertibleTo(ValueType other) const { |
| 2214 | switch (other) { |
no outgoing calls
no test coverage detected