| 513 | } |
| 514 | |
| 515 | bool TJsonValue::GetBooleanRobust() const noexcept { |
| 516 | switch (Type) { |
| 517 | case JSON_ARRAY: |
| 518 | return !Value.Array->empty(); |
| 519 | case JSON_MAP: |
| 520 | return !Value.Map->empty(); |
| 521 | case JSON_INTEGER: |
| 522 | case JSON_UINTEGER: |
| 523 | case JSON_DOUBLE: |
| 524 | return GetIntegerRobust(); |
| 525 | case JSON_STRING: |
| 526 | return GetIntegerRobust() || IsTrue(Value.String); |
| 527 | case JSON_NULL: |
| 528 | case JSON_UNDEFINED: |
| 529 | default: |
| 530 | return false; |
| 531 | case JSON_BOOLEAN: |
| 532 | return Value.Boolean; |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | long long TJsonValue::GetIntegerRobust() const noexcept { |
| 537 | switch (Type) { |