| 435 | } |
| 436 | |
| 437 | double TJsonValue::GetDouble() const { |
| 438 | if (!IsDouble()) { |
| 439 | return 0.0; |
| 440 | } |
| 441 | switch (Type) { |
| 442 | case JSON_DOUBLE: |
| 443 | return Value.Double; |
| 444 | case JSON_INTEGER: |
| 445 | return Value.Integer; |
| 446 | case JSON_UINTEGER: |
| 447 | return Value.UInteger; |
| 448 | default: |
| 449 | Y_ASSERT(false && "Unexpected type."); |
| 450 | return 0.0; |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | const TString& TJsonValue::GetString() const { |
| 455 | return Type != JSON_STRING ? Singleton<TDefaultsHolder>()->String : Value.String; |
no test coverage detected