MCPcopy Create free account
hub / github.com/catboost/catboost / GetBooleanRobust

Method GetBooleanRobust

library/cpp/json/writer/json_value.cpp:515–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 2

IsTrueFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected