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

Method asInt

cpp/cppsdk/jsoncpp.cpp:3155–3175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3153#endif
3154
3155Value::Int Value::asInt() const {
3156 switch (type_) {
3157 case intValue:
3158 JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range");
3159 return Int(value_.int_);
3160 case uintValue:
3161 JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range");
3162 return Int(value_.uint_);
3163 case realValue:
3164 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt),
3165 "double out of Int range");
3166 return Int(value_.real_);
3167 case nullValue:
3168 return 0;
3169 case booleanValue:
3170 return value_.bool_ ? 1 : 0;
3171 default:
3172 break;
3173 }
3174 JSON_FAIL_MESSAGE("Value is not convertible to Int.");
3175}
3176
3177Value::UInt Value::asUInt() const {
3178 switch (type_) {

Callers 6

JsonFileConfigurationMethod · 0.80
newCharReaderMethod · 0.80
FromJsonMethod · 0.80
CurlReceiveDataMethod · 0.80
FromJsonUtilPFunction · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected