MCPcopy Create free account
hub / github.com/Illumina/paragraph / asBool

Method asBool

external/jsoncpp/jsoncpp.cpp:3351–3368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3349}
3350
3351bool Value::asBool() const {
3352 switch (type_) {
3353 case booleanValue:
3354 return value_.bool_;
3355 case nullValue:
3356 return false;
3357 case intValue:
3358 return value_.int_ ? true : false;
3359 case uintValue:
3360 return value_.uint_ ? true : false;
3361 case realValue:
3362 // This is kind of strange. Not recommended.
3363 return (value_.real_ != 0.0) ? true : false;
3364 default:
3365 break;
3366 }
3367 JSON_FAIL_MESSAGE("Value is not convertible to bool.");
3368}
3369
3370bool Value::isConvertibleTo(ValueType other) const {
3371 switch (other) {

Callers 3

newCharReaderMethod · 0.80
writeValueMethod · 0.80
newStreamWriterMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected