mirror of
https://github.com/nlohmann/json.git
synced 2025-07-28 12:02:00 +03:00
Consolidate documentation (#3071)
* 🔥 consolidate documentation * ♻️ overwork std specializations * 🚚 move images files to mkdocs * ♻️ fix URLs * 🔧 tweak MkDocs configuration * 🔧 add namespaces * 📝 document deprecations * 📝 document documentation generation * 🚸 improve search * 🚸 add examples * 🚧 start adding documentation for macros * 📝 add note for https://github.com/nlohmann/json/issues/874#issuecomment-1001699139 * 📝 overwork example handling * 📝 fix Markdown tables
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
# basic_json::accept
|
||||
# <small>nlohmann::basic_json::</small>accept
|
||||
|
||||
```cpp
|
||||
// (1)
|
||||
@ -17,7 +17,7 @@ Checks whether the input is valid JSON.
|
||||
1. Reads from a compatible input.
|
||||
2. Reads from a pair of character iterators
|
||||
|
||||
The value_type of the iterator must be a integral type with size of 1, 2 or 4 bytes, which will be interpreted
|
||||
The value_type of the iterator must be an integral type with size of 1, 2 or 4 bytes, which will be interpreted
|
||||
respectively as UTF-8, UTF-16 and UTF-32.
|
||||
|
||||
Unlike the [`parse`](parse.md) function, this function neither throws an exception in case of invalid JSON input
|
||||
@ -84,7 +84,21 @@ Linear in the length of the input. The parser is a predictive LL(1) parser.
|
||||
--8<-- "examples/accept__string.output"
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [parse](parse.md) - deserialize from a compatible input
|
||||
- [operator>>](operator_gtgt.md) - deserialize from stream
|
||||
|
||||
## Version history
|
||||
|
||||
- Added in version 3.0.0.
|
||||
- Ignoring comments via `ignore_comments` added in version 3.9.0.
|
||||
|
||||
!!! warning "Deprecation"
|
||||
|
||||
Overload (2) replaces calls to `accept` with a pair of iterators as their first parameter which has been
|
||||
deprecated in version 3.8.0. This overload will be removed in version 4.0.0. Please replace all calls like
|
||||
`#!cpp accept({ptr, ptr+len}, ...);` with `#!cpp accept(ptr, ptr+len, ...);`.
|
||||
|
||||
You should be warned by your compiler with a `-Wdeprecated-declarations` warning if you are using a deprecated
|
||||
function.
|
||||
|
Reference in New Issue
Block a user