Apply suggestions from code review
Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
This commit is contained in:
parent
823877e426
commit
efffa2876b
@ -29,7 +29,7 @@ When the macro is not defined, the library will define it to its default value.
|
|||||||
!!! hint "CMake option"
|
!!! hint "CMake option"
|
||||||
|
|
||||||
The placement of user-defined string literals can also be controlled with the CMake option
|
The placement of user-defined string literals can also be controlled with the CMake option
|
||||||
[`JSON_GlobalUDLs`](../../integration/cmake.md#json_globaludls) (`OFF` by default) which defines
|
[`JSON_GlobalUDLs`](../../integration/cmake.md#json_globaludls) (`ON` by default) which defines
|
||||||
`JSON_USE_GLOBAL_UDLS` accordingly.
|
`JSON_USE_GLOBAL_UDLS` accordingly.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|||||||
@ -101,7 +101,7 @@ The library uses the following mapping from JSON values types to BJData types ac
|
|||||||
optimized array in UBJSON `[ [$U#i2 1 2 [$U#i2 3 4 [$U#i2 5 6 ]`, can be further compressed in BJData to
|
optimized array in UBJSON `[ [$U#i2 1 2 [$U#i2 3 4 [$U#i2 5 6 ]`, can be further compressed in BJData to
|
||||||
`[$U#[$i#i2 2 3 1 2 3 4 5 6` or `[$U#[i2 i3] 1 2 3 4 5 6`.
|
`[$U#[$i#i2 2 3 1 2 3 4 5 6` or `[$U#[i2 i3] 1 2 3 4 5 6`.
|
||||||
|
|
||||||
To maintina type and size information, ND-arrays are converted to JSON objects following the **annotated array
|
To maintain type and size information, ND-arrays are converted to JSON objects following the **annotated array
|
||||||
format** (defined in the [JData specification (Draft 3)][JDataAAFmt]), when parsed using
|
format** (defined in the [JData specification (Draft 3)][JDataAAFmt]), when parsed using
|
||||||
[`from_bjdata`](../../api/basic_json/from_bjdata.md). For example, the above 2-D `uint8` array can be parsed and
|
[`from_bjdata`](../../api/basic_json/from_bjdata.md). For example, the above 2-D `uint8` array can be parsed and
|
||||||
accessed as
|
accessed as
|
||||||
|
|||||||
@ -23,8 +23,8 @@ In case exceptions are undesired or not supported by the environment, there are
|
|||||||
|
|
||||||
## Switch off exceptions
|
## Switch off exceptions
|
||||||
|
|
||||||
The `parse()` function accepts as last parameter a `#!cpp bool` variable `allow_exceptions` which controls whether an
|
The `parse()` function accepts a `#!cpp bool` parameter `allow_exceptions` which controls whether an exception is
|
||||||
exception is thrown when a parse error occurs (`#!cpp true`, default) or whether a discarded value should be returned
|
thrown when a parse error occurs (`#!cpp true`, default) or whether a discarded value should be returned
|
||||||
(`#!cpp false`).
|
(`#!cpp false`).
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
|
|||||||
@ -60,8 +60,8 @@ table describes the values of the parameters `depth`, `event`, and `parsed`.
|
|||||||
|
|
||||||
## Return value
|
## Return value
|
||||||
|
|
||||||
Discarding a value (i.e., returning `#!c false`) has different effects depending on the context in which function was
|
Discarding a value (i.e., returning `#!c false`) has different effects depending on the context in which the function
|
||||||
called:
|
was called:
|
||||||
|
|
||||||
- Discarded values in structured types are skipped. That is, the parser will behave as if the discarded value was never
|
- Discarded values in structured types are skipped. That is, the parser will behave as if the discarded value was never
|
||||||
read.
|
read.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user