MCPcopy Create free account
hub / github.com/Illumina/hap.py / Value

Method Value

external/jsoncpp/jsoncpp.cpp:1727–1767  ·  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

1725 * This optimization is used in ValueInternalMap fast allocator.
1726 */
1727Value::Value(ValueType type)
1728 : type_(type), allocated_(false)
1729#ifdef JSON_VALUE_USE_INTERNAL_MAP
1730 ,
1731 itemIsUsed_(0)
1732#endif
1733 ,
1734 comments_(0), start_(0), limit_(0) {
1735 switch (type) {
1736 case nullValue:
1737 break;
1738 case intValue:
1739 case uintValue:
1740 value_.int_ = 0;
1741 break;
1742 case realValue:
1743 value_.real_ = 0.0;
1744 break;
1745 case stringValue:
1746 value_.string_ = 0;
1747 break;
1748#ifndef JSON_VALUE_USE_INTERNAL_MAP
1749 case arrayValue:
1750 case objectValue:
1751 value_.map_ = new ObjectValues();
1752 break;
1753#else
1754 case arrayValue:
1755 value_.array_ = arrayAllocator()->newArray();
1756 break;
1757 case objectValue:
1758 value_.map_ = mapAllocator()->newMap();
1759 break;
1760#endif
1761 case booleanValue:
1762 value_.bool_ = false;
1763 break;
1764 default:
1765 JSON_ASSERT_UNREACHABLE;
1766 }
1767}
1768
1769Value::Value(UInt value)
1770 : type_(uintValue), allocated_(false)

Callers

nothing calls this directly

Calls 3

duplicateStringValueFunction · 0.85
c_strMethod · 0.80
setCommentMethod · 0.80

Tested by

no test coverage detected