! \internal Default constructor initialization must be equivalent to: * memset( this, 0, sizeof(Value) ) * This optimization is used in ValueInternalMap fast allocator. */
| 2739 | * This optimization is used in ValueInternalMap fast allocator. |
| 2740 | */ |
| 2741 | Value::Value(ValueType vtype) { |
| 2742 | initBasic(vtype); |
| 2743 | switch (vtype) { |
| 2744 | case nullValue: |
| 2745 | break; |
| 2746 | case intValue: |
| 2747 | case uintValue: |
| 2748 | value_.int_ = 0; |
| 2749 | break; |
| 2750 | case realValue: |
| 2751 | value_.real_ = 0.0; |
| 2752 | break; |
| 2753 | case stringValue: |
| 2754 | value_.string_ = 0; |
| 2755 | break; |
| 2756 | case arrayValue: |
| 2757 | case objectValue: |
| 2758 | value_.map_ = new ObjectValues(); |
| 2759 | break; |
| 2760 | case booleanValue: |
| 2761 | value_.bool_ = false; |
| 2762 | break; |
| 2763 | default: |
| 2764 | JSON_ASSERT_UNREACHABLE; |
| 2765 | } |
| 2766 | } |
| 2767 | |
| 2768 | Value::Value(Int value) { |
| 2769 | initBasic(intValue); |
nothing calls this directly
no test coverage detected