Ditto 4.8.0
Loading...
Searching...
No Matches
json_pointer< RefStringType > Class Template Reference

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

#include <json.hpp>

Public Types

using string_t = typename string_t_helper<RefStringType>::type
 

Public Member Functions

 json_pointer (const string_t &s="")
 create JSON pointer
 
string_t to_string () const
 return a string representation of the JSON pointer
 
 operator string_t () const
 return a string representation of the JSON pointer
 
json_pointeroperator/= (const json_pointer &ptr)
 append another JSON pointer at the end of this JSON pointer
 
json_pointeroperator/= (string_t token)
 append an unescaped reference token at the end of this JSON pointer
 
json_pointeroperator/= (std::size_t array_idx)
 append an array index at the end of this JSON pointer
 
json_pointer parent_pointer () const
 returns the parent of this JSON pointer
 
void pop_back ()
 remove last reference token
 
const string_t & back () const
 return last reference token
 
void push_back (const string_t &token)
 append an unescaped token at the end of the reference pointer
 
void push_back (string_t &&token)
 append an unescaped token at the end of the reference pointer
 
bool empty () const noexcept
 return whether pointer points to the root document
 

Detailed Description

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/

Constructor & Destructor Documentation

◆ json_pointer()

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

Member Function Documentation

◆ back()

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

return last reference token

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

◆ empty()

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

return whether pointer points to the root document

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

◆ operator string_t()

template<typename RefStringType >
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/

◆ operator/=() [1/3]

template<typename RefStringType >
json_pointer & 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/

◆ operator/=() [2/3]

template<typename RefStringType >
json_pointer & 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/

◆ operator/=() [3/3]

template<typename RefStringType >
json_pointer & 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/

◆ parent_pointer()

template<typename RefStringType >
json_pointer 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/

◆ pop_back()

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

remove last reference token

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

◆ push_back() [1/2]

template<typename RefStringType >
void 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/

◆ push_back() [2/2]

template<typename RefStringType >
void 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/

◆ to_string()

template<typename RefStringType >
string_t 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/