You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The types for `Nul`, `Bol` and `Num` are completely fixed. For `Str`, `Array` and `Object`, the memory allocator can be customized through template parameter `AllocatorType`.
54
-
While `Object` can choose between ordered or hash-based implementations, the class templates themselves remain fixed.
53
+
The types for `Nul`, `Bol` and `Num` are completely fixed. For `Str`, `Arr` and `Obj`, the memory allocator can be customized through template parameter `AllocatorType`.
54
+
While `Obj` can choose between ordered or hash-based implementations, the class templates themselves remain fixed.
55
55
56
56
By default:
57
57
-`Str` equals `std::string`
58
-
-`Array` equals `std::vector<Json>`
59
-
-`Object` equals `std::map<Str, Json>`
58
+
-`Arr` equals `std::vector<Json>`
59
+
-`Obj` equals `std::map<Str, Json>`
60
60
61
61
## Member Variables
62
62
@@ -69,8 +69,8 @@ std::variant<
69
69
Bol,
70
70
Num,
71
71
Str,
72
-
Array,
73
-
Object
72
+
Arr,
73
+
Obj
74
74
> m_data { Nul{} };
75
75
```
76
76
@@ -89,14 +89,14 @@ std::variant<
89
89
- [is_bol](is_bol.md): Check if current JSON is `Bol`
90
90
- [is_num](is_num.md): Check if current JSON is `Num`
91
91
- [is_str](is_str.md): Check if current JSON is `Str`
92
-
- [is_arr](is_arr.md): Check if current JSON is `Array`
93
-
- [is_obj](is_obj.md): Check if current JSON is `Object`
92
+
- [is_arr](is_arr.md): Check if current JSON is `Arr`
93
+
- [is_obj](is_obj.md): Check if current JSON is `Obj`
94
94
- [nul](get_nul.md): Get reference to internal `Nul` data
95
95
- [bol](get_bol.md): Get reference to internal `Bol` data
96
96
- [num](get_num.md): Get reference to internal `Num` data
97
97
- [str](get_str.md): Get reference to internal `Str` data
98
-
- [arr](get_arr.md): Get reference to internal `Array` data
99
-
- [obj](get_obj.md): Get reference to internal `Object` data
98
+
- [arr](get_arr.md): Get reference to internal `Arr` data
99
+
- [obj](get_obj.md): Get reference to internal `Obj` data
1. If the internal data type is `Object`, delete the key-value pair for the specified key. If the type does not match or the key does not exist, return `false` (no exception will be thrown). Return `true` if the deletion succeeds.
11
+
1. If the internal data type is `Obj`, delete the key-value pair for the specified key. If the type does not match or the key does not exist, return `false` (no exception will be thrown). Return `true` if the deletion succeeds.
12
12
13
-
2. If the internal data type is `Array`, delete the element at the specified index. If the type does not match or the index is out of bounds, return `false` (no exception will be thrown). Return `true` if the deletion succeeds.
13
+
2. If the internal data type is `Arr`, delete the element at the specified index. If the type does not match or the index is out of bounds, return `false` (no exception will be thrown). Return `true` if the deletion succeeds.
1. If the internal data type is `Object`, insert the specified key-value pair (overwriting if it already exists) and return `true`. If the type does not match, return `false` (no exception will be thrown).
15
+
1. If the internal data type is `Obj`, insert the specified key-value pair (overwriting if it already exists) and return `true`. If the type does not match, return `false` (no exception will be thrown).
16
16
17
-
2. If the internal data type is `Array` and the index is within range (end index allowed), insert the specified element and return `true`. If the type does not match or the index is out of bounds, return `false` (no exception will be thrown).
17
+
2. If the internal data type is `Arr` and the index is within range (end index allowed), insert the specified element and return `true`. If the type does not match or the index is out of bounds, return `false` (no exception will be thrown).
0 commit comments