SIRIUS 7.5.0
Electronic structure library and applications
|
JSON Pointer defines a string syntax for identifying a specific value within a JSON document. More...
#include <nlohmann_json.hpp>
Classes | |
struct | string_t_helper |
struct | string_t_helper< NLOHMANN_BASIC_JSON_TPL > |
Public Types | |
using | string_t = typename string_t_helper< RefStringType >::type |
Public Member Functions | |
json_pointer (const string_t &s="") | |
create JSON pointer More... | |
string_t | to_string () const |
return a string representation of the JSON pointer More... | |
operator string_t () const | |
return a string representation of the JSON pointer More... | |
json_pointer & | operator/= (const json_pointer &ptr) |
append another JSON pointer at the end of this JSON pointer More... | |
json_pointer & | operator/= (string_t token) |
append an unescaped reference token at the end of this JSON pointer More... | |
json_pointer & | operator/= (std::size_t array_idx) |
append an array index at the end of this JSON pointer More... | |
json_pointer | parent_pointer () const |
returns the parent of this JSON pointer More... | |
void | pop_back () |
remove last reference token More... | |
const string_t & | back () const |
return last reference token More... | |
void | push_back (const string_t &token) |
append an unescaped token at the end of the reference pointer More... | |
void | push_back (string_t &&token) |
append an unescaped token at the end of the reference pointer More... | |
bool | empty () const noexcept |
return whether pointer points to the root document More... | |
Private Member Functions | |
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_unchecked (BasicJsonType *ptr) const |
return a reference to the pointed to value More... | |
template<typename BasicJsonType > | |
BasicJsonType & | get_checked (BasicJsonType *ptr) const |
template<typename BasicJsonType > | |
const BasicJsonType & | get_unchecked (const BasicJsonType *ptr) const |
return a const reference to the pointed to value More... | |
template<typename BasicJsonType > | |
const BasicJsonType & | get_checked (const BasicJsonType *ptr) const |
template<typename BasicJsonType > | |
bool | contains (const BasicJsonType *ptr) const |
json_pointer< string_t > | convert () const & |
json_pointer< string_t > | convert () && |
Static Private Member Functions | |
template<typename BasicJsonType > | |
static BasicJsonType::size_type | array_index (const string_t &s) |
static std::vector< string_t > | split (const string_t &reference_string) |
split the string input to reference tokens More... | |
template<typename BasicJsonType > | |
static void | flatten (const string_t &reference_string, const BasicJsonType &value, BasicJsonType &result) |
template<typename BasicJsonType > | |
static BasicJsonType | unflatten (const BasicJsonType &value) |
Private Attributes | |
JSON_PRIVATE_UNLESS_TESTED | __pad0__: json_pointer top() const { if (JSON_HEDLEY_UNLIKELY(empty())) { JSON_THROW(detail::out_of_range::create(405 |
JSON_PRIVATE_UNLESS_TESTED JSON pointer has no | parent |
JSON_PRIVATE_UNLESS_TESTED JSON pointer has no | nullptr |
json_pointer | result = *this |
result | reference_tokens = {reference_tokens[0]} |
return | result |
std::vector< string_t > | reference_tokens |
the reference tokens More... | |
Friends | |
class | basic_json |
std::ostream & | operator<< (std::ostream &o, const json_pointer &ptr) |
write string representation of the JSON pointer to stream 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, string_t token) |
create a new JSON pointer by appending the unescaped token at the end of the 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... | |
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 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... | |
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... | |
JSON Pointer defines a string syntax for identifying a specific value within a JSON document.
Definition at line 13754 of file nlohmann_json.hpp.
using json_pointer< RefStringType >::string_t = typename string_t_helper<RefStringType>::type |
Definition at line 13777 of file nlohmann_json.hpp.
|
inlineexplicit |
create JSON pointer
Definition at line 13781 of file nlohmann_json.hpp.
|
inline |
return a string representation of the JSON pointer
Definition at line 13787 of file nlohmann_json.hpp.
|
inline |
return a string representation of the JSON pointer
Definition at line 13800 of file nlohmann_json.hpp.
|
inline |
append another JSON pointer at the end of this JSON pointer
Definition at line 13817 of file nlohmann_json.hpp.
|
inline |
append an unescaped reference token at the end of this JSON pointer
Definition at line 13827 of file nlohmann_json.hpp.
|
inline |
append an array index at the end of this JSON pointer
Definition at line 13835 of file nlohmann_json.hpp.
|
inline |
returns the parent of this JSON pointer
Definition at line 13864 of file nlohmann_json.hpp.
|
inline |
remove last reference token
Definition at line 13878 of file nlohmann_json.hpp.
|
inline |
return last reference token
Definition at line 13890 of file nlohmann_json.hpp.
|
inline |
append an unescaped token at the end of the reference pointer
Definition at line 13902 of file nlohmann_json.hpp.
|
inline |
append an unescaped token at the end of the reference pointer
Definition at line 13909 of file nlohmann_json.hpp.
|
inlinenoexcept |
return whether pointer points to the root document
Definition at line 13916 of file nlohmann_json.hpp.
|
inlinestaticprivate |
[in] | s | reference token to be converted into an array index |
parse_error.106 | if an array index begins with '0' |
parse_error.109 | if an array index begins not with a digit |
out_of_range.404 | if string s could not be converted to an integer |
out_of_range.410 | if an array index exceeds size_type |
Definition at line 13933 of file nlohmann_json.hpp.
|
inlineprivate |
create and return a reference to the pointed to value
@complexity Linear in the number of reference tokens.
parse_error.109 | if array index is not a number |
type_error.313 | if value cannot be unflattened |
Definition at line 13993 of file nlohmann_json.hpp.
|
inlineprivate |
return a reference to the pointed to value
"/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.[in] | ptr | a JSON value |
@complexity Linear in the length of the JSON pointer.
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 14073 of file nlohmann_json.hpp.
|
inlineprivate |
parse_error.106 | if an array index begins with '0' |
parse_error.109 | if an array index was not a number |
out_of_range.402 | if the array index '-' is used |
out_of_range.404 | if the JSON pointer can not be resolved |
Definition at line 14141 of file nlohmann_json.hpp.
|
inlineprivate |
return a const reference to the pointed to value
[in] | ptr | a JSON value |
parse_error.106 | if an array index begins with '0' |
parse_error.109 | if an array index was not a number |
out_of_range.402 | if the array index '-' is used |
out_of_range.404 | if the JSON pointer can not be resolved |
Definition at line 14199 of file nlohmann_json.hpp.
|
inlineprivate |
parse_error.106 | if an array index begins with '0' |
parse_error.109 | if an array index was not a number |
out_of_range.402 | if the array index '-' is used |
out_of_range.404 | if the JSON pointer can not be resolved |
Definition at line 14248 of file nlohmann_json.hpp.
|
inlineprivate |
parse_error.106 | if an array index begins with '0' |
parse_error.109 | if an array index was not a number |
Definition at line 14297 of file nlohmann_json.hpp.
|
inlinestaticprivate |
split the string input to reference tokens
parse_error.107 | if the pointer is not empty or begins with '/' |
parse_error.108 | if character '~' is not followed by '0' or '1' |
Definition at line 14385 of file nlohmann_json.hpp.
|
inlinestaticprivate |
[in] | reference_string | the reference string to the current value |
[in] | value | the value to consider |
[in,out] | result | the result object to insert values to |
null
. Definition at line 14454 of file nlohmann_json.hpp.
|
inlinestaticprivate |
[in] | value | flattened JSON |
parse_error.109 | if array index is not a number |
type_error.314 | if value is not an object |
type_error.315 | if object values are not primitive |
type_error.313 | if value cannot be unflattened |
Definition at line 14526 of file nlohmann_json.hpp.
|
inlineprivate |
Definition at line 14554 of file nlohmann_json.hpp.
|
inlineprivate |
Definition at line 14561 of file nlohmann_json.hpp.
|
friend |
Definition at line 13758 of file nlohmann_json.hpp.
Definition at line 13761 of file nlohmann_json.hpp.
|
friend |
write string representation of the JSON pointer to stream
Definition at line 13808 of file nlohmann_json.hpp.
|
friend |
create a new JSON pointer by appending the right JSON pointer at the end of the left JSON pointer
Definition at line 13842 of file nlohmann_json.hpp.
|
friend |
create a new JSON pointer by appending the unescaped token at the end of the JSON pointer
Definition at line 13850 of file nlohmann_json.hpp.
|
friend |
create a new JSON pointer by appending the array-index-token at the end of the JSON pointer
Definition at line 13857 of file nlohmann_json.hpp.
|
friend |
compares two JSON pointers for equality
Definition at line 14650 of file nlohmann_json.hpp.
|
friend |
compares JSON pointer and string for equality
Definition at line 14659 of file nlohmann_json.hpp.
|
friend |
compares string and JSON pointer for equality
Definition at line 14668 of file nlohmann_json.hpp.
|
friend |
compares two JSON pointers for inequality
Definition at line 14675 of file nlohmann_json.hpp.
|
friend |
compares JSON pointer and string for inequality
Definition at line 14684 of file nlohmann_json.hpp.
|
friend |
compares string and JSON pointer for inequality
Definition at line 14693 of file nlohmann_json.hpp.
|
friend |
compares two JSON pointer for less-than
Definition at line 14700 of file nlohmann_json.hpp.
|
private |
Definition at line 13970 of file nlohmann_json.hpp.
|
private |
Definition at line 13975 of file nlohmann_json.hpp.
|
private |
Definition at line 13975 of file nlohmann_json.hpp.
|
private |
Definition at line 13978 of file nlohmann_json.hpp.
|
private |
Definition at line 13979 of file nlohmann_json.hpp.
|
private |
Definition at line 13980 of file nlohmann_json.hpp.
|
private |
the reference tokens
Definition at line 14644 of file nlohmann_json.hpp.