mirror of
https://github.com/nlohmann/json.git
synced 2026-04-07 08:38:54 +00:00
Some documentation updates (#4636)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -138,3 +138,7 @@ result in undefined behavior. Since version 3.11.4, this library checks for `nul
|
||||
```
|
||||
[json.exception.parse_error.101] parse error: attempting to parse an empty input; check that your input string or stream contains the expected JSON
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [JSON_ASSERT](../api/macros/json_assert.md) - control behavior of runtime assertions
|
||||
|
||||
@@ -24,11 +24,26 @@ When enabled, exception messages contain a [JSON Pointer](json_pointer.md) to th
|
||||
exception, see [Extended diagnostic messages](../home/exceptions.md#extended-diagnostic-messages) for an example. Note
|
||||
that enabling this macro increases the size of every JSON value by one pointer and adds some runtime overhead.
|
||||
|
||||
The diagnostics messages can also be controlled with the CMake option `JSON_Diagnostics` (`OFF` by default) which sets
|
||||
`JSON_DIAGNOSTICS` accordingly.
|
||||
The diagnostics messages can also be controlled with the CMake option
|
||||
[`JSON_Diagnostics`](../integration/cmake.md#json_diagnostics) (`OFF` by default) which sets `JSON_DIAGNOSTICS`
|
||||
accordingly.
|
||||
|
||||
See [full documentation of `JSON_DIAGNOSTICS`](../api/macros/json_diagnostics.md).
|
||||
|
||||
## `JSON_DIAGNOSTIC_POSITIONS`
|
||||
|
||||
When enabled, two new member functions [`start_pos()`](../api/basic_json/start_pos.md) and
|
||||
[`end_pos()`](../api/basic_json/end_pos.md) are added to [`basic_json`](../api/basic_json/index.md) values. If the value
|
||||
was created by calling the[`parse`](../api/basic_json/parse.md) function, then these functions allow to query the byte
|
||||
positions of the value in the input it was parsed from. The byte positions are also used in exceptions to help locate
|
||||
errors.
|
||||
|
||||
The diagnostics positions can also be controlled with the CMake option
|
||||
[`JSON_Diagnostic_Positions`](../integration/cmake.md#json_diagnostic_positions) (`OFF` by default) which sets
|
||||
`JSON_DIAGNOSTIC_POSITIONS` accordingly.
|
||||
|
||||
See [full documentation of `JSON_DIAGNOSTIC_POSITIONS`](../api/macros/json_diagnostic_positions.md)
|
||||
|
||||
## `JSON_HAS_CPP_11`, `JSON_HAS_CPP_14`, `JSON_HAS_CPP_17`, `JSON_HAS_CPP_20`
|
||||
|
||||
The library targets C++11, but also supports some features introduced in later C++ versions (e.g., `std::string_view`
|
||||
|
||||
Reference in New Issue
Block a user