MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / asBool

Method asBool

Libraries/jsoncpp-0.y.z/src/lib_json/json_value.cpp:785–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

783}
784
785bool Value::asBool() const {
786 switch (type_) {
787 case booleanValue:
788 return value_.bool_;
789 case nullValue:
790 return false;
791 case intValue:
792 return value_.int_ ? true : false;
793 case uintValue:
794 return value_.uint_ ? true : false;
795 case realValue:
796 // This is kind of strange. Not recommended.
797 return (value_.real_ != 0.0) ? true : false;
798 default:
799 break;
800 }
801 JSON_FAIL_MESSAGE("Value is not convertible to bool.");
802}
803
804bool Value::isConvertibleTo(ValueType other) const {
805 switch (other) {

Callers 5

newCharReaderMethod · 0.45
writeValueMethod · 0.45
newStreamWriterMethod · 0.45
printValueTreeFunction · 0.45
JSONTEST_FIXTUREFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected