MCPcopy Create free account
hub / github.com/Samsung/UTopia / asString

Method asString

external/jsoncpp/jsoncpp.cpp:3026–3050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3024}
3025
3026String Value::asString() const {
3027 switch (type()) {
3028 case nullValue:
3029 return "";
3030 case stringValue: {
3031 if (value_.string_ == nullptr)
3032 return "";
3033 unsigned this_len;
3034 char const *this_str;
3035 decodePrefixedString(this->isAllocated(), this->value_.string_, &this_len,
3036 &this_str);
3037 return String(this_str, this_len);
3038 }
3039 case booleanValue:
3040 return value_.bool_ ? "true" : "false";
3041 case intValue:
3042 return valueToString(value_.int_);
3043 case uintValue:
3044 return valueToString(value_.uint_);
3045 case realValue:
3046 return valueToString(value_.real_);
3047 default:
3048 JSON_FAIL_MESSAGE("Type is not convertible to string");
3049 }
3050}
3051
3052#ifdef JSON_USE_CPPTL
3053CppTL::ConstString Value::asConstString() const {

Callers 14

loadMethod · 0.80
fromJsonMethod · 0.80
exportUTsReportJsonMethod · 0.80
fromJsonMethod · 0.80
APICallMethod · 0.80
UnittestMethod · 0.80
FunctionNodeMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80

Calls 2

decodePrefixedStringFunction · 0.85
valueToStringFunction · 0.85

Tested by 1

UnittestMethod · 0.64