MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / asBool

Method asBool

src/share/jsoncpp/jsoncpp.cpp:3306–3323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3304}
3305
3306bool Value::asBool() const {
3307 switch (type_) {
3308 case booleanValue:
3309 return value_.bool_;
3310 case nullValue:
3311 return false;
3312 case intValue:
3313 return value_.int_ ? true : false;
3314 case uintValue:
3315 return value_.uint_ ? true : false;
3316 case realValue:
3317 // This is kind of strange. Not recommended.
3318 return (value_.real_ != 0.0) ? true : false;
3319 default:
3320 break;
3321 }
3322 JSON_FAIL_MESSAGE("Value is not convertible to bool.");
3323}
3324
3325bool Value::isConvertibleTo(ValueType other) const {
3326 switch (other) {

Callers 8

getBoolValueFromJSONFunction · 0.80
fromJsonMethod · 0.80
newCharReaderMethod · 0.80
writeValueMethod · 0.80
newStreamWriterMethod · 0.80
saveDataMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected