MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / Value

Method Value

Sources/Dependencies/jsoncpp/value.cpp:348–375  ·  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

346 * This optimization is used in ValueInternalMap fast allocator.
347 */
348 Value::Value(ValueType type) {
349 static char const emptyString[] = "";
350 initBasic(type);
351 switch (type) {
352 case nullValue:
353 break;
354 case intValue:
355 case uintValue:
356 value_.int_ = 0;
357 break;
358 case realValue:
359 value_.real_ = 0.0;
360 break;
361 case stringValue:
362 // allocated_ == false, so this is safe.
363 value_.string_ = const_cast<char*>(static_cast<char const*>(emptyString));
364 break;
365 case arrayValue:
366 case objectValue:
367 value_.map_ = new ObjectValues();
368 break;
369 case booleanValue:
370 value_.bool_ = false;
371 break;
372 default:
373 JSON_ASSERT_UNREACHABLE;
374 }
375 }
376
377 Value::Value(Int value) {
378 initBasic(intValue);

Callers

nothing calls this directly

Calls 5

c_strMethod · 0.80
swapFunction · 0.70
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected