MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / asBool

Method asBool

src/jsoncpp.cpp:3261–3280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3259}
3260
3261bool Value::asBool() const {
3262 switch (type_) {
3263 case booleanValue:
3264 return value_.bool_;
3265 case nullValue:
3266 return false;
3267 case intValue:
3268 return value_.int_ ? true : false;
3269 case uintValue:
3270 return value_.uint_ ? true : false;
3271 case realValue:
3272 // This is kind of strange. Not recommended.
3273 return (value_.real_ != 0.0) ? true : false;
3274 default:
3275 if ( default_value_ )
3276 return default_value_->asBool();
3277 else
3278 return false;
3279 }
3280}
3281
3282bool Value::isConvertibleTo(ValueType other) const {
3283 switch (other) {

Callers 3

newCharReaderMethod · 0.80
writeValueMethod · 0.80
newStreamWriterMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected