MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / Value

Method Value

edrav2/eprj/jsoncpp/src/lib_json/json_value.cpp:383–410  ·  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

381 * This optimization is used in ValueInternalMap fast allocator.
382 */
383Value::Value(ValueType type) {
384 static char const emptyString[] = "";
385 initBasic(type);
386 switch (type) {
387 case nullValue:
388 break;
389 case intValue:
390 case uintValue:
391 value_.int_ = 0;
392 break;
393 case realValue:
394 value_.real_ = 0.0;
395 break;
396 case stringValue:
397 // allocated_ == false, so this is safe.
398 value_.string_ = const_cast<char*>(static_cast<char const*>(emptyString));
399 break;
400 case arrayValue:
401 case objectValue:
402 value_.map_ = new ObjectValues();
403 break;
404 case booleanValue:
405 value_.bool_ = false;
406 break;
407 default:
408 JSON_ASSERT_UNREACHABLE;
409 }
410}
411
412Value::Value(Int value) {
413 initBasic(intValue);

Callers

nothing calls this directly

Calls 6

strlenFunction · 0.85
swapFunction · 0.50
dataMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected