MCPcopy Create free account
hub / github.com/cuberite/cuberite / Value

Method Value

lib/jsoncpp/src/lib_json/json_value.cpp:269–310  ·  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

267 * This optimization is used in ValueInternalMap fast allocator.
268 */
269Value::Value( ValueType type )
270 : type_( type )
271 , allocated_( 0 )
272 , comments_( 0 )
273# ifdef JSON_VALUE_USE_INTERNAL_MAP
274 , itemIsUsed_( 0 )
275#endif
276{
277 switch ( type )
278 {
279 case nullValue:
280 break;
281 case intValue:
282 case uintValue:
283 value_.int_ = 0;
284 break;
285 case realValue:
286 value_.real_ = 0.0;
287 break;
288 case stringValue:
289 value_.string_ = 0;
290 break;
291#ifndef JSON_VALUE_USE_INTERNAL_MAP
292 case arrayValue:
293 case objectValue:
294 value_.map_ = new ObjectValues();
295 break;
296#else
297 case arrayValue:
298 value_.array_ = arrayAllocator()->newArray();
299 break;
300 case objectValue:
301 value_.map_ = mapAllocator()->newMap();
302 break;
303#endif
304 case booleanValue:
305 value_.bool_ = false;
306 break;
307 default:
308 JSON_ASSERT_UNREACHABLE;
309 }
310}
311
312
313Value::Value( Int value )

Callers

nothing calls this directly

Calls 3

duplicateStringValueMethod · 0.80
c_strMethod · 0.80
setCommentMethod · 0.80

Tested by

no test coverage detected