LLBC_Variant &LLBC_Variant::BecomeUInt64() { if (!IsUInt64()) { *this = AsUInt64(); } return *this; }
uint64_t JsValue::GetUInt64() const { std::string whyNot; if (not _CheckType(_holder->type, IntType, &whyNot)) { TF_CODING_ERROR(whyNot); return 0; } if (not IsUInt64()) return static_cast<uint64_t>(GetInt64()); return boost::get<uint64_t>(_holder->value); }
double JsValue::GetReal() const { if (_holder->type == IntType) { return IsUInt64() ? static_cast<double>(GetUInt64()) : static_cast<double>(GetInt64()); } std::string whyNot; if (not _CheckType(_holder->type, RealType, &whyNot)) { TF_CODING_ERROR(whyNot); return 0; } return boost::get<double>(_holder->value); }