JSON Pointer defines a string syntax for identifying a specific value within a JSON document.
More...
|
| template<typename BasicJsonType > |
| bool | contains (const BasicJsonType *ptr) const |
| |
| json_pointer< string_t > | convert () && |
| |
| json_pointer< string_t > | convert () const & |
| |
| template<typename BasicJsonType > |
| BasicJsonType & | get_and_create (BasicJsonType &j) const |
| | create and return a reference to the pointed to value More...
|
| |
| template<typename BasicJsonType > |
| BasicJsonType & | get_checked (BasicJsonType *ptr) const |
| |
| template<typename BasicJsonType > |
| const BasicJsonType & | get_checked (const BasicJsonType *ptr) const |
| |
| template<typename BasicJsonType > |
| BasicJsonType & | get_unchecked (BasicJsonType *ptr) const |
| | return a reference to the pointed to value More...
|
| |
| template<typename BasicJsonType > |
| const BasicJsonType & | get_unchecked (const BasicJsonType *ptr) const |
| | return a const reference to the pointed to value More...
|
| |
|
| template<typename BasicJsonType > |
| static BasicJsonType::size_type | array_index (const string_t &s) |
| |
| template<typename BasicJsonType > |
| static void | flatten (const string_t &reference_string, const BasicJsonType &value, BasicJsonType &result) |
| |
| static std::vector< string_t > | split (const string_t &reference_string) |
| | split the string input to reference tokens More...
|
| |
| template<typename BasicJsonType > |
| static BasicJsonType | unflatten (const BasicJsonType &value) |
| |
|
| class | basic_json |
| |
| template<typename > |
| class | json_pointer |
| |
| template<typename RefStringTypeLhs , typename RefStringTypeRhs > |
| bool | operator!= (const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept |
| | compares two JSON pointers for inequality More...
|
| |
| template<typename RefStringTypeLhs , typename StringType > |
| bool | operator!= (const json_pointer< RefStringTypeLhs > &lhs, const StringType &rhs) |
| | compares JSON pointer and string for inequality More...
|
| |
| template<typename RefStringTypeRhs , typename StringType > |
| bool | operator!= (const StringType &lhs, const json_pointer< RefStringTypeRhs > &rhs) |
| | compares string and JSON pointer for inequality More...
|
| |
| json_pointer | operator/ (const json_pointer &lhs, const json_pointer &rhs) |
| | create a new JSON pointer by appending the right JSON pointer at the end of the left JSON pointer More...
|
| |
| json_pointer | operator/ (const json_pointer &lhs, std::size_t array_idx) |
| | create a new JSON pointer by appending the array-index-token at the end of the JSON pointer More...
|
| |
| json_pointer | operator/ (const json_pointer &lhs, string_t token) |
| | create a new JSON pointer by appending the unescaped token at the end of the JSON pointer More...
|
| |
| template<typename RefStringTypeLhs , typename RefStringTypeRhs > |
| bool | operator< (const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept |
| | compares two JSON pointer for less-than More...
|
| |
| std::ostream & | operator<< (std::ostream &o, const json_pointer &ptr) |
| | write string representation of the JSON pointer to stream More...
|
| |
| template<typename RefStringTypeLhs , typename RefStringTypeRhs > |
| bool | operator== (const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept |
| | compares two JSON pointers for equality More...
|
| |
| template<typename RefStringTypeLhs , typename StringType > |
| bool | operator== (const json_pointer< RefStringTypeLhs > &lhs, const StringType &rhs) |
| | compares JSON pointer and string for equality More...
|
| |
| template<typename RefStringTypeRhs , typename StringType > |
| bool | operator== (const StringType &lhs, const json_pointer< RefStringTypeRhs > &rhs) |
| | compares string and JSON pointer for equality More...
|
| |
template<typename RefStringType>
class json_pointer< RefStringType >
JSON Pointer defines a string syntax for identifying a specific value within a JSON document.
- See also
- https://json.nlohmann.me/api/json_pointer/
Definition at line 3416 of file json.hpp.
template<typename RefStringType >
template<typename BasicJsonType >
| BasicJsonType& json_pointer< RefStringType >::get_and_create |
( |
BasicJsonType & |
j | ) |
const |
|
inlineprivate |
create and return a reference to the pointed to value
@complexity Linear in the number of reference tokens.
- Exceptions
-
| parse_error.109 | if array index is not a number |
| type_error.313 | if value cannot be unflattened |
Definition at line 14079 of file json.hpp.
template<typename RefStringType >
template<typename BasicJsonType >
| BasicJsonType& json_pointer< RefStringType >::get_unchecked |
( |
BasicJsonType * |
ptr | ) |
const |
|
inlineprivate |
return a reference to the pointed to value
- Note
- This version does not throw if a value is not present, but tries to create nested values instead. For instance, calling this function with pointer
"/this/that" on a null value is equivalent to calling operator[]("this").operator[]("that") on that value, effectively changing the null value to an object.
- Parameters
-
- Returns
- reference to the JSON value pointed to by the JSON pointer
@complexity Linear in the length of the JSON pointer.
- Exceptions
-
| parse_error.106 | if an array index begins with '0' |
| parse_error.109 | if an array index was not a number |
| out_of_range.404 | if the JSON pointer can not be resolved |
Definition at line 14159 of file json.hpp.