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

Method asString

runtime/3rdparty/jsoncpp/jsoncpp.cpp:3297–3323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3295}
3296
3297String Value::asString() const
3298{
3299 switch (type())
3300 {
3301 case nullValue:
3302 return "";
3303 case stringValue:
3304 {
3305 if (value_.string_ == nullptr)
3306 return "";
3307 unsigned this_len;
3308 char const *this_str;
3309 decodePrefixedString(this->isAllocated(), this->value_.string_, &this_len, &this_str);
3310 return String(this_str, this_len);
3311 }
3312 case booleanValue:
3313 return value_.bool_ ? "true" : "false";
3314 case intValue:
3315 return valueToString(value_.int_);
3316 case uintValue:
3317 return valueToString(value_.uint_);
3318 case realValue:
3319 return valueToString(value_.real_);
3320 default:
3321 JSON_FAIL_MESSAGE("Type is not convertible to string");
3322 }
3323}
3324
3325Value::Int Value::asInt() const
3326{

Callers 8

writeMethod · 0.45
readFunction · 0.45
TEST_FFunction · 0.45
read_layer_paramsFunction · 0.45
read_layer_params_setFunction · 0.45
readObjectMethod · 0.45
newStreamWriterMethod · 0.45

Calls 4

decodePrefixedStringFunction · 0.85
valueToStringFunction · 0.85
typeFunction · 0.50
StringFunction · 0.50

Tested by 1

TEST_FFunction · 0.36