mirror of
https://github.com/nlohmann/json.git
synced 2025-07-29 23:01:16 +03:00
📝 add more API documentation
This commit is contained in:
@ -49,7 +49,7 @@ Todo
|
||||
## Member types
|
||||
|
||||
- [**value_t**](value_t.md) - the JSON type enumeration
|
||||
- json_pointer
|
||||
- [**json_pointer**](../json_pointer.md) - JSON Pointer implementation
|
||||
- json_serializer
|
||||
- [**error_handler_t**](error_handler_t.md) - type to choose behavior on decoding errors
|
||||
- cbor_tag_handler_t
|
||||
@ -245,8 +245,8 @@ Access to the JSON value
|
||||
|
||||
## Literals
|
||||
|
||||
- operator""_json
|
||||
- operator""_json_pointer
|
||||
- [**operator""_json**](operator%22%22_json.md) - user-defined string literal for JSON values
|
||||
- [**operator""_json_pointer**](operator%22%22_json_pointer.md) - user-defined string literal for JSON pointers
|
||||
|
||||
## Helper classes
|
||||
|
||||
|
32
doc/mkdocs/docs/api/basic_json/operator""_json.md
Normal file
32
doc/mkdocs/docs/api/basic_json/operator""_json.md
Normal file
@ -0,0 +1,32 @@
|
||||
# basic_json::operator""_json
|
||||
|
||||
```cpp
|
||||
json operator "" _json(const char* s, std::size_t n)
|
||||
```
|
||||
|
||||
This operator implements a user-defined string literal for JSON objects. It can be used by adding `#!cpp _json` to a
|
||||
string literal and returns a [`json`](../json.md) object if no parse error occurred.
|
||||
|
||||
## Parameters
|
||||
|
||||
`s` (in)
|
||||
: a string representation of a JSON object
|
||||
|
||||
`n` (in)
|
||||
: length of string `s`
|
||||
|
||||
## Return value
|
||||
|
||||
[`json`](../json.md) value parsed from `s`
|
||||
|
||||
## Exceptions
|
||||
|
||||
The function can throw anything that [`parse(s, s+n)`](parse.md) would throw.
|
||||
|
||||
## Complexity
|
||||
|
||||
Linear.
|
||||
|
||||
## Version history
|
||||
|
||||
- Added in version 1.0.0.
|
32
doc/mkdocs/docs/api/basic_json/operator""_json_pointer.md
Normal file
32
doc/mkdocs/docs/api/basic_json/operator""_json_pointer.md
Normal file
@ -0,0 +1,32 @@
|
||||
# basic_json::operator""_json_pointer
|
||||
|
||||
```cpp
|
||||
json_pointer operator "" _json_pointer(const char* s, std::size_t n)
|
||||
```
|
||||
|
||||
This operator implements a user-defined string literal for JSON Pointers. It can be used by adding `#!cpp _json_pointer`
|
||||
to a string literal and returns a [`json_pointer`](../json_pointer.md) object if no parse error occurred.
|
||||
|
||||
## Parameters
|
||||
|
||||
`s` (in)
|
||||
: a string representation of a JSON Pointer
|
||||
|
||||
`n` (in)
|
||||
: length of string `s`
|
||||
|
||||
## Return value
|
||||
|
||||
[`json_pointer`](../json_pointer.md) value parsed from `s`
|
||||
|
||||
## Exceptions
|
||||
|
||||
The function can throw anything that [`json_pointer::json_pointer`](../json_pointer.md) would throw.
|
||||
|
||||
## Complexity
|
||||
|
||||
Linear.
|
||||
|
||||
## Version history
|
||||
|
||||
- Added in version 2.0.0.
|
24
doc/mkdocs/docs/api/json_pointer.md
Normal file
24
doc/mkdocs/docs/api/json_pointer.md
Normal file
@ -0,0 +1,24 @@
|
||||
# json_pointer
|
||||
|
||||
```cpp
|
||||
template<typename BasicJsonType>
|
||||
class json_pointer;
|
||||
```
|
||||
|
||||
## Template parameters
|
||||
|
||||
`BasicJsonType`
|
||||
: a specialization of [`basic_json`](basic_json/index.md)
|
||||
|
||||
## Member functions
|
||||
|
||||
- (constructor)
|
||||
- **to_string** - return a string representation of the JSON pointer
|
||||
- **operator std::string**- return a string representation of the JSON pointer
|
||||
- **operator/=** - append to the end of the JSON pointer
|
||||
- **operator/** - create JSON Pointer by appending
|
||||
- **parent_pointer** - returns the parent of this JSON pointer
|
||||
- **pop_back** - remove last reference token
|
||||
- **back** - return last reference token
|
||||
- **push_back** - append an unescaped token at the end of the pointer
|
||||
- **empty** - return whether pointer points to the root document
|
Reference in New Issue
Block a user