mirror of
https://github.com/nlohmann/json.git
synced 2026-04-07 08:38:54 +00:00
Fix typos (#4748)
* ✏️ fix typos Signed-off-by: Niels Lohmann <mail@nlohmann.me> * ✏️ address review comments Signed-off-by: Niels Lohmann <mail@nlohmann.me> * ✏️ address review comments Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# CBOR
|
||||
|
||||
The Concise Binary Object Representation (CBOR) is a data format whose design goals include the possibility of extremely
|
||||
small code size, fairly small message size, and extensibility without the need for version negotiation.
|
||||
The Concise Binary Object Representation (CBOR) is a data format whose design goals include the possibility of
|
||||
extremely small code sizes, fairly small message size, and extensibility without the need for version negotiation.
|
||||
|
||||
!!! abstract "References"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Binary Values
|
||||
|
||||
The library implements several [binary formats](binary_formats/index.md) that encode JSON in an efficient way. Most of
|
||||
these formats support binary values; that is, values that have semantics define outside the library and only define a
|
||||
these formats support binary values; that is, values that have semantics defined outside the library and only define a
|
||||
sequence of bytes to be stored.
|
||||
|
||||
JSON itself does not have a binary value. As such, binary values are an extension that this library implements to store
|
||||
@@ -189,7 +189,7 @@ as an array of uint8 values. The library implements this translation.
|
||||
|
||||
### BSON
|
||||
|
||||
[BSON](binary_formats/bson.md) supports binary values and subtypes. If a subtype is given, it is used and added as
|
||||
[BSON](binary_formats/bson.md) supports binary values and subtypes. If a subtype is given, it is used and added as an
|
||||
unsigned 8-bit integer. If no subtype is given, the generic binary subtype 0x00 is used.
|
||||
|
||||
??? example
|
||||
@@ -274,7 +274,7 @@ byte array.
|
||||
|
||||
[MessagePack](binary_formats/messagepack.md) supports binary values and subtypes. If a subtype is given, the ext family
|
||||
is used. The library will choose the smallest representation among fixext1, fixext2, fixext4, fixext8, ext8, ext16, and
|
||||
ext32. The subtype is then added as signed 8-bit integer.
|
||||
ext32. The subtype is then added as a signed 8-bit integer.
|
||||
|
||||
If no subtype is given, the bin family (bin8, bin16, bin32) is used.
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Specializing enum conversion
|
||||
|
||||
By default, enum values are serialized to JSON as integers. In some cases this could result in undesired behavior. If an
|
||||
enum is modified or re-ordered after data has been serialized to JSON, the later deserialized JSON data may be
|
||||
undefined or a different enum value than was originally intended.
|
||||
By default, enum values are serialized to JSON as integers. In some cases, this could result in undesired behavior. If
|
||||
the integer values of any enum values are changed after data using those enum values has been serialized to JSON, then
|
||||
deserializing that JSON would result in a different enum value being restored, or the value not being found at all.
|
||||
|
||||
It is possible to more precisely specify how a given enum is mapped to and from JSON as shown below:
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ When iterating over objects, values are ordered with respect to the `object_comp
|
||||
|
||||
The reason for the order is the lexicographic ordering of the object keys "one", "three", "two".
|
||||
|
||||
### Access object key during iteration
|
||||
### Access object keys during iteration
|
||||
|
||||
The JSON iterators have two member functions, `key()` and `value()` to access the object key and stored value, respectively. When calling `key()` on a non-object iterator, an [invalid_iterator.207](../home/exceptions.md#jsonexceptioninvalid_iterator207) exception is thrown.
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ configurations – to be used in cases where the linker would otherwise output u
|
||||
|
||||
To do so, define [`NLOHMANN_JSON_NAMESPACE_NO_VERSION`](../api/macros/nlohmann_json_namespace_no_version.md) to `1`.
|
||||
|
||||
This applies to version 3.11.2 and above only, versions 3.11.0 and 3.11.1 can apply the technique described in the next
|
||||
This applies to version 3.11.2 and above only; versions 3.11.0 and 3.11.1 can apply the technique described in the next
|
||||
section to emulate the effect of the `NLOHMANN_JSON_NAMESPACE_NO_VERSION` macro.
|
||||
|
||||
!!! danger "Use at your own risk"
|
||||
|
||||
Reference in New Issue
Block a user