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

Method asBool

Source/JSON/jsoncpp.cpp:2943–2960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2941}
2942
2943bool Value::asBool() const {
2944 switch (type_) {
2945 case booleanValue:
2946 return value_.bool_;
2947 case nullValue:
2948 return false;
2949 case intValue:
2950 return value_.int_ ? true : false;
2951 case uintValue:
2952 return value_.uint_ ? true : false;
2953 case realValue:
2954 // This is kind of strange. Not recommended.
2955 return (value_.real_ != 0.0) ? true : false;
2956 default:
2957 break;
2958 }
2959 JSON_FAIL_MESSAGE("Value is not convertible to bool.");
2960}
2961
2962bool Value::isConvertibleTo(ValueType other) const {
2963 switch (other) {

Callers 3

newCharReaderMethod · 0.45
writeValueMethod · 0.45
newStreamWriterMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected