This commit is contained in:
nlohmann
2026-09-24 07:41:05 +00:00
parent 8539704c02
commit b090a9e4ab
277 changed files with 947 additions and 500 deletions
File diff suppressed because one or more lines are too long
+4
View File
@@ -64,6 +64,8 @@ This is tracked in [#5340](https://github.com/nlohmann/json/issues/5340).
Note that reading concatenated values does **not** work for [JSON Lines](https://json.nlohmann.me/features/parsing/json_lines/index.md) (newline-delimited JSON) input -- see that page for why and for the recommended alternative.
By default, a `'\0'` (NUL) byte encountered while reading a value is treated as end of input, rather than as an ordinary (and, outside of a string, invalid) byte; see the [FAQ entry](https://json.nlohmann.me/home/faq/#nul-bytes-in-the-input) for details and the [`JSON_STRICT_NUL_HANDLING`](https://json.nlohmann.me/api/macros/json_strict_nul_handling/index.md) macro to opt into rejecting it instead. Because `operator>>` only parses a single value and does not require the rest of the stream to be consumed, a NUL byte *after* a complete value has no effect on `operator>>` either way; it only matters while a value is still being read.
Deprecation
This function replaces function `std::istream& operator<<(basic_json& j, std::istream& i)` which has been deprecated in version 3.0.0. It will be removed in version 4.0.0. Please replace calls like `j << i;` with `i >> j;`.
@@ -125,7 +127,9 @@ Output:
- [accept](https://json.nlohmann.me/api/basic_json/accept/index.md) - check if the input is valid JSON
- [parse](https://json.nlohmann.me/api/basic_json/parse/index.md) - deserialize from a compatible input
- [`JSON_STRICT_NUL_HANDLING`](https://json.nlohmann.me/api/macros/json_strict_nul_handling/index.md) - opt in to rejecting a NUL byte in the input instead of treating it as end of input
## Version history
- Added in version 1.0.0.
- `JSON_STRICT_NUL_HANDLING` added in version 3.13.0 to optionally reject a NUL byte in the input instead of treating it as end of input; planned to become the default in version 4.0.0.