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

Method GetBooleanRobust

library/cpp/json/ordered_maps/json_value_ordered.cpp:558–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Y_UNIT_TESTFunction · 0.45

Calls 2

IsTrueFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected