MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Value

Method Value

Libraries/jsoncpp-0.y.z/src/lib_json/json_value.cpp:299–324  ·  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

297 * This optimization is used in ValueInternalMap fast allocator.
298 */
299Value::Value(ValueType vtype) {
300 initBasic(vtype);
301 switch (vtype) {
302 case nullValue:
303 break;
304 case intValue:
305 case uintValue:
306 value_.int_ = 0;
307 break;
308 case realValue:
309 value_.real_ = 0.0;
310 break;
311 case stringValue:
312 value_.string_ = 0;
313 break;
314 case arrayValue:
315 case objectValue:
316 value_.map_ = new ObjectValues();
317 break;
318 case booleanValue:
319 value_.bool_ = false;
320 break;
321 default:
322 JSON_ASSERT_UNREACHABLE;
323 }
324}
325
326Value::Value(Int value) {
327 initBasic(intValue);

Callers 1

subst_emitterFunction · 0.45

Calls 6

decodePrefixedStringFunction · 0.70
dataMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45
setCommentMethod · 0.45

Tested by

no test coverage detected