When I ask type of rapidjson::Value
using GetType()
method, it returns only belows Type:
//! Type of JSON value
enum Type {
kNullType = 0, //!< null
kFalseType = 1, //!< false
kTrueType = 2, //!< true
kObjectType = 3, //!< object
kArrayType = 4, //!< array
kStringType = 5, //!< string
kNumberType = 6 //!< number
};
As you can see, there are no such kIntType
nor kDoubleType
(even kUintType
, kInt64Type
) Therefore, I can't get actual value of rapidjson::Value
.
For example:
if (value.GetType() == rapidjson::kNumberType)
{
double v = value.GetDouble() // this?
unsigned long v = value.GetUInt64() // or this??
int v = value.GetInt() // or this?
}
Is there anyway to distinguish actual numeric type?
Thanks.