MCPcopy Create free account
hub / github.com/Kitware/VTK / asUInt

Method asUInt

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:3114–3134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3112}
3113
3114Value::UInt Value::asUInt() const {
3115 switch (type()) {
3116 case intValue:
3117 JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
3118 return UInt(value_.int_);
3119 case uintValue:
3120 JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
3121 return UInt(value_.uint_);
3122 case realValue:
3123 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
3124 "double out of UInt range");
3125 return UInt(value_.real_);
3126 case nullValue:
3127 return 0;
3128 case booleanValue:
3129 return value_.bool_ ? 1 : 0;
3130 default:
3131 break;
3132 }
3133 JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
3134}
3135
3136#if defined(JSON_HAS_INT64)
3137

Callers 4

GetUIntValueFunction · 0.80
GetUIntArrayFunction · 0.80
newCharReaderMethod · 0.80
newStreamWriterMethod · 0.80

Calls 2

InRangeFunction · 0.85
typeEnum · 0.50

Tested by

no test coverage detected