| 556 | } |
| 557 | |
| 558 | bool TJsonValue::GetBooleanRobust() const noexcept { |
| 559 | switch (Type) { |
| 560 | case JSON_ARRAY: |
| 561 | return !Value.Array->empty(); |
| 562 | case JSON_MAP: |
| 563 | return !Value.Map->empty(); |
| 564 | case JSON_INTEGER: |
| 565 | case JSON_UINTEGER: |
| 566 | case JSON_DOUBLE: |
| 567 | return GetIntegerRobust(); |
| 568 | case JSON_STRING: |
| 569 | return GetIntegerRobust() || IsTrue(Value.String); |
| 570 | case JSON_NULL: |
| 571 | case JSON_UNDEFINED: |
| 572 | default: |
| 573 | return false; |
| 574 | case JSON_BOOLEAN: |
| 575 | return Value.Boolean; |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | long long TJsonValue::GetIntegerRobust() const noexcept { |
| 580 | switch (Type) { |
no test coverage detected