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

Method Value

runtime/3rdparty/jsoncpp/jsoncpp.cpp:2996–3025  ·  view source on GitHub ↗

! \internal Default constructor initialization must be equivalent to: * memset( this, 0, sizeof(Value) ) * This optimization is used in ValueInternalMap fast allocator. */

Source from the content-addressed store, hash-verified

2994 * This optimization is used in ValueInternalMap fast allocator.
2995 */
2996Value::Value(ValueType type)
2997{
2998 static char const emptyString[] = "";
2999 initBasic(type);
3000 switch (type)
3001 {
3002 case nullValue:
3003 break;
3004 case intValue:
3005 case uintValue:
3006 value_.int_ = 0;
3007 break;
3008 case realValue:
3009 value_.real_ = 0.0;
3010 break;
3011 case stringValue:
3012 // allocated_ == false, so this is safe.
3013 value_.string_ = const_cast<char *>(static_cast<char const *>(emptyString));
3014 break;
3015 case arrayValue:
3016 case objectValue:
3017 value_.map_ = new ObjectValues();
3018 break;
3019 case booleanValue:
3020 value_.bool_ = false;
3021 break;
3022 default:
3023 JSON_ASSERT_UNREACHABLE;
3024 }
3025}
3026
3027Value::Value(Int value)
3028{

Callers 1

_generate_inputsFunction · 0.45

Calls 5

swapFunction · 0.50
dataMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected