MCPcopy Create free account
hub / github.com/PlayFab/gsdk / asBool

Method asBool

cpp/cppsdk/jsoncpp.cpp:3305–3322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 4

newCharReaderMethod · 0.80
writeValueMethod · 0.80
newStreamWriterMethod · 0.80
FromJsonUtilPFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected