MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / asBool

Method asBool

edrav2/eprj/jsoncpp/src/lib_json/json_value.cpp:867–884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

865}
866
867bool Value::asBool() const {
868 switch (type_) {
869 case booleanValue:
870 return value_.bool_;
871 case nullValue:
872 return false;
873 case intValue:
874 return value_.int_ ? true : false;
875 case uintValue:
876 return value_.uint_ ? true : false;
877 case realValue:
878 // This is kind of strange. Not recommended.
879 return (value_.real_ != 0.0) ? true : false;
880 default:
881 break;
882 }
883 JSON_FAIL_MESSAGE("Value is not convertible to bool.");
884}
885
886bool Value::isConvertibleTo(ValueType other) const {
887 switch (other) {

Callers 7

newCharReaderMethod · 0.80
writeValueMethod · 0.80
newStreamWriterMethod · 0.80
printValueTreeFunction · 0.80
JSONTEST_FIXTUREFunction · 0.80
saveJsonToVariantFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected