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

Method dupPayload

runtime/3rdparty/jsoncpp/jsoncpp.cpp:3666–3700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3664}
3665
3666void Value::dupPayload(const Value &other)
3667{
3668 setType(other.type());
3669 setIsAllocated(false);
3670 switch (type())
3671 {
3672 case nullValue:
3673 case intValue:
3674 case uintValue:
3675 case realValue:
3676 case booleanValue:
3677 value_ = other.value_;
3678 break;
3679 case stringValue:
3680 if (other.value_.string_ && other.isAllocated())
3681 {
3682 unsigned len;
3683 char const *str;
3684 decodePrefixedString(other.isAllocated(), other.value_.string_, &len, &str);
3685 value_.string_ = duplicateAndPrefixStringValue(str, len);
3686 setIsAllocated(true);
3687 }
3688 else
3689 {
3690 value_.string_ = other.value_.string_;
3691 }
3692 break;
3693 case arrayValue:
3694 case objectValue:
3695 value_.map_ = new ObjectValues(*other.value_.map_);
3696 break;
3697 default:
3698 JSON_ASSERT_UNREACHABLE;
3699 }
3700}
3701
3702void Value::releasePayload()
3703{

Callers

nothing calls this directly

Calls 5

setIsAllocatedFunction · 0.85
decodePrefixedStringFunction · 0.85
typeFunction · 0.50
typeMethod · 0.45

Tested by

no test coverage detected