MCPcopy Create free account
hub / github.com/SOUI2/soui / Value

Method Value

third-part/jsoncpp/src/lib_json/json_value.cpp:355–382  ·  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

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

Callers

nothing calls this directly

Calls 7

decodePrefixedStringFunction · 0.85
setCommentMethod · 0.80
swapFunction · 0.50
dataMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected