This commit is contained in:
nlohmann
2026-10-03 05:43:12 +00:00
parent 2aaa1d24ef
commit a410b4f40f
741 changed files with 8115 additions and 2252 deletions
File diff suppressed because one or more lines are too long
+13
View File
@@ -10,11 +10,19 @@ Create a JSON pointer according to the syntax described in [Section 3 of RFC6901
`s` (in) : string representing the JSON pointer; if omitted, the empty string is assumed which references the whole JSON value
## Exception safety
Strong guarantee: if an exception is thrown, there are no changes to any JSON pointer.
## Exceptions
- Throws [parse_error.107](https://json.nlohmann.me/home/exceptions/#jsonexceptionparse_error107) if the given JSON pointer `s` is nonempty and does not begin with a slash (`/`); see example below.
- Throws [parse_error.108](https://json.nlohmann.me/home/exceptions/#jsonexceptionparse_error108) if a tilde (`~`) in the given JSON pointer `s` is not followed by `0` (representing `~`) or `1` (representing `/`); see example below.
## Complexity
Linear in the length of `s`.
## Examples
Example
@@ -79,6 +87,11 @@ Output:
[json.exception.parse_error.108] parse error: escape character '~' must be followed with '0' or '1'
```
## See also
- [JSON Pointer](https://json.nlohmann.me/features/json_pointer/index.md) - the article on JSON Pointer support
- [operator""\_json_pointer](https://json.nlohmann.me/api/operator_literal_json_pointer/index.md) user-defined string literal for JSON pointers
## Version history
- Added in version 2.0.0.