MCPcopy Create free account
hub / github.com/Samsung/UTopia / asBool

Method asBool

external/jsoncpp/jsoncpp.cpp:3211–3228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3209}
3210
3211bool Value::asBool() const {
3212 switch (type()) {
3213 case booleanValue:
3214 return value_.bool_;
3215 case nullValue:
3216 return false;
3217 case intValue:
3218 return value_.int_ ? true : false;
3219 case uintValue:
3220 return value_.uint_ ? true : false;
3221 case realValue:
3222 // This is kind of strange. Not recommended.
3223 return (value_.real_ != 0.0) ? true : false;
3224 default:
3225 break;
3226 }
3227 JSON_FAIL_MESSAGE("Value is not convertible to bool.");
3228}
3229
3230bool Value::isConvertibleTo(ValueType other) const {
3231 switch (other) {

Callers 10

FunctionNodeMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
newCharReaderMethod · 0.80
writeValueMethod · 0.80
newStreamWriterMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected