int64_t UniValue::get_int64() const { if (typ != VNUM) throw std::runtime_error("JSON value is not an integer as expected"); int64_t retval; if (!ParseInt64(getValStr(), &retval)) throw std::runtime_error("JSON integer out of range"); return retval; }
double UniValue::get_real() const { if (typ != VNUM) throw std::runtime_error("JSON value is not a number as expected"); double retval; if (!ParseDouble(getValStr(), &retval)) throw std::runtime_error("JSON double out of range"); return retval; }
Variant SSATmp::getValVariant() const { switch (m_inst->typeParam().toDataType()) { case KindOfUninit: return uninit_null(); case KindOfNull: return init_null(); case KindOfBoolean: return getValBool(); case KindOfInt64: return getValInt(); case KindOfDouble: return getValDbl(); case KindOfString: case KindOfStaticString: return Variant(getValStr()); case KindOfArray: return const_cast<ArrayData*>(getValArr()); default: always_assert(false); } }
const std::string& UniValue::get_str() const { if (typ != VSTR) throw std::runtime_error("JSON value is not a string as expected"); return getValStr(); }
const std::string DataRef::getSerStr() { changed = false; std::string retval(ser_code); return retval + getValStr() + '\n'; }