Instrument Neutral Distributed Interface INDI  2.0.2
Public Types | Public Member Functions | Friends | List of all members
nlohmann::json_pointer< RefStringType > Class Template Reference

JSON Pointer defines a string syntax for identifying a specific value within a JSON document. More...

#include <json.h>

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_pointeroperator/= (const json_pointer &ptr)
 append another JSON pointer at the end of this JSON pointer More...
 
json_pointeroperator/= (string_t token)
 append an unescaped reference token at the end of this JSON pointer More...
 
json_pointeroperator/= (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_tback () 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...
 

Friends

class basic_json
 
template<typename >
class json_pointer
 
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== (json_pointer< RefStringTypeLhs > const &lhs, json_pointer< RefStringTypeRhs > const &rhs) noexcept
 compares two JSON pointers for equality More...
 
template<typename RefStringTypeLhs , typename RefStringTypeRhs >
bool operator!= (json_pointer< RefStringTypeLhs > const &lhs, json_pointer< RefStringTypeRhs > const &rhs) noexcept
 compares two JSON pointers for inequality More...
 

Detailed Description

template<typename RefStringType>
class nlohmann::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 13242 of file json.h.

Member Typedef Documentation

◆ string_t

template<typename RefStringType >
using nlohmann::json_pointer< RefStringType >::string_t = typename string_t_helper<RefStringType>::type

Definition at line 13265 of file json.h.

Constructor & Destructor Documentation

◆ json_pointer()

template<typename RefStringType >
nlohmann::json_pointer< RefStringType >::json_pointer ( const string_t s = "")
inlineexplicit

create JSON pointer

See also
https://json.nlohmann.me/api/json_pointer/json_pointer/

Definition at line 13269 of file json.h.

Member Function Documentation

◆ back()

template<typename RefStringType >
const string_t& nlohmann::json_pointer< RefStringType >::back ( ) const
inline

return last reference token

See also
https://json.nlohmann.me/api/json_pointer/back/

Definition at line 13367 of file json.h.

◆ empty()

template<typename RefStringType >
bool nlohmann::json_pointer< RefStringType >::empty ( ) const
inlinenoexcept

return whether pointer points to the root document

See also
https://json.nlohmann.me/api/json_pointer/empty/

Definition at line 13393 of file json.h.

◆ operator string_t()

template<typename RefStringType >
nlohmann::json_pointer< RefStringType >::operator string_t ( ) const
inline

return a string representation of the JSON pointer

See also
https://json.nlohmann.me/api/json_pointer/operator_string/

Definition at line 13287 of file json.h.

◆ operator/=() [1/3]

template<typename RefStringType >
json_pointer& nlohmann::json_pointer< RefStringType >::operator/= ( const json_pointer< RefStringType > &  ptr)
inline

append another JSON pointer at the end of this JSON pointer

See also
https://json.nlohmann.me/api/json_pointer/operator_slasheq/

Definition at line 13294 of file json.h.

◆ operator/=() [2/3]

template<typename RefStringType >
json_pointer& nlohmann::json_pointer< RefStringType >::operator/= ( std::size_t  array_idx)
inline

append an array index at the end of this JSON pointer

See also
https://json.nlohmann.me/api/json_pointer/operator_slasheq/

Definition at line 13312 of file json.h.

◆ operator/=() [3/3]

template<typename RefStringType >
json_pointer& nlohmann::json_pointer< RefStringType >::operator/= ( string_t  token)
inline

append an unescaped reference token at the end of this JSON pointer

See also
https://json.nlohmann.me/api/json_pointer/operator_slasheq/

Definition at line 13304 of file json.h.

◆ parent_pointer()

template<typename RefStringType >
json_pointer nlohmann::json_pointer< RefStringType >::parent_pointer ( ) const
inline

returns the parent of this JSON pointer

See also
https://json.nlohmann.me/api/json_pointer/parent_pointer/

Definition at line 13341 of file json.h.

◆ pop_back()

template<typename RefStringType >
void nlohmann::json_pointer< RefStringType >::pop_back ( )
inline

remove last reference token

See also
https://json.nlohmann.me/api/json_pointer/pop_back/

Definition at line 13355 of file json.h.

◆ push_back() [1/2]

template<typename RefStringType >
void nlohmann::json_pointer< RefStringType >::push_back ( const string_t token)
inline

append an unescaped token at the end of the reference pointer

See also
https://json.nlohmann.me/api/json_pointer/push_back/

Definition at line 13379 of file json.h.

◆ push_back() [2/2]

template<typename RefStringType >
void nlohmann::json_pointer< RefStringType >::push_back ( string_t &&  token)
inline

append an unescaped token at the end of the reference pointer

See also
https://json.nlohmann.me/api/json_pointer/push_back/

Definition at line 13386 of file json.h.

◆ to_string()

template<typename RefStringType >
string_t nlohmann::json_pointer< RefStringType >::to_string ( ) const
inline

return a string representation of the JSON pointer

See also
https://json.nlohmann.me/api/json_pointer/to_string/

Definition at line 13275 of file json.h.

Friends And Related Function Documentation

◆ basic_json

template<typename RefStringType >
friend class basic_json
friend

Definition at line 13246 of file json.h.

◆ json_pointer

template<typename RefStringType >
template<typename >
friend class json_pointer
friend

Definition at line 13249 of file json.h.

◆ operator!=

template<typename RefStringType >
template<typename RefStringTypeLhs , typename RefStringTypeRhs >
bool operator!= ( json_pointer< RefStringTypeLhs > const &  lhs,
json_pointer< RefStringTypeRhs > const &  rhs 
)
friend

compares two JSON pointers for inequality

Parameters
[in]lhsJSON pointer to compare
[in]rhsJSON pointer to compare
Returns
whether lhs is not equal rhs

@complexity Linear in the length of the JSON pointer

@exceptionsafety No-throw guarantee: this function never throws exceptions.

Definition at line 14090 of file json.h.

◆ operator/ [1/3]

template<typename RefStringType >
json_pointer operator/ ( const json_pointer< RefStringType > &  lhs,
const json_pointer< RefStringType > &  rhs 
)
friend

create a new JSON pointer by appending the right JSON pointer at the end of the left JSON pointer

See also
https://json.nlohmann.me/api/json_pointer/operator_slash/

Definition at line 13319 of file json.h.

◆ operator/ [2/3]

template<typename RefStringType >
json_pointer operator/ ( const json_pointer< RefStringType > &  lhs,
std::size_t  array_idx 
)
friend

create a new JSON pointer by appending the array-index-token at the end of the JSON pointer

See also
https://json.nlohmann.me/api/json_pointer/operator_slash/

Definition at line 13334 of file json.h.

◆ operator/ [3/3]

template<typename RefStringType >
json_pointer operator/ ( const json_pointer< RefStringType > &  lhs,
string_t  token 
)
friend

create a new JSON pointer by appending the unescaped token at the end of the JSON pointer

See also
https://json.nlohmann.me/api/json_pointer/operator_slash/

Definition at line 13327 of file json.h.

◆ operator==

template<typename RefStringType >
template<typename RefStringTypeLhs , typename RefStringTypeRhs >
bool operator== ( json_pointer< RefStringTypeLhs > const &  lhs,
json_pointer< RefStringTypeRhs > const &  rhs 
)
friend

compares two JSON pointers for equality

Parameters
[in]lhsJSON pointer to compare
[in]rhsJSON pointer to compare
Returns
whether lhs is equal to rhs

@complexity Linear in the length of the JSON pointer

@exceptionsafety No-throw guarantee: this function never throws exceptions.

Definition at line 14083 of file json.h.


The documentation for this class was generated from the following file: