| 392 | } |
| 393 | |
| 394 | double TJsonValue::GetDouble() const { |
| 395 | if (!IsDouble()) { |
| 396 | return 0.0; |
| 397 | } |
| 398 | switch (Type) { |
| 399 | case JSON_DOUBLE: |
| 400 | return Value.Double; |
| 401 | case JSON_INTEGER: |
| 402 | return Value.Integer; |
| 403 | case JSON_UINTEGER: |
| 404 | return Value.UInteger; |
| 405 | default: |
| 406 | Y_ASSERT(false && "Unexpected type."); |
| 407 | return 0.0; |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | const TString& TJsonValue::GetString() const { |
| 412 | return Type != JSON_STRING ? Singleton<TDefaultsHolder>()->String : Value.String; |
no test coverage detected