Goby3  3.1.5a
2024.05.23
json_pointer< RefStringType > Class Template Reference

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

#include <goby/util/thirdparty/nlohmann/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 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
 
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...
 

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/

Definition at line 3398 of file json.hpp.

Member Typedef Documentation

◆ string_t

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

Definition at line 13739 of file json.hpp.

Constructor & Destructor Documentation

◆ json_pointer()

template<typename RefStringType >
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 13743 of file json.hpp.

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/

Definition at line 13852 of file json.hpp.

◆ 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/

Definition at line 13878 of file json.hpp.

◆ 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/

Definition at line 13762 of file json.hpp.

◆ 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/

Definition at line 13779 of file json.hpp.

◆ 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/

Definition at line 13797 of file json.hpp.

◆ 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/

Definition at line 13789 of file json.hpp.

◆ 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/

Definition at line 13826 of file json.hpp.

◆ 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/

Definition at line 13840 of file json.hpp.

◆ 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/

Definition at line 13864 of file json.hpp.

◆ 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/

Definition at line 13871 of file json.hpp.

◆ 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/

Definition at line 13749 of file json.hpp.

Friends And Related Function Documentation

◆ basic_json

template<typename RefStringType >
friend class basic_json
friend

Definition at line 13720 of file json.hpp.

◆ json_pointer

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

Definition at line 13723 of file json.hpp.

◆ operator!= [1/3]

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

compares two JSON pointers for inequality

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

Definition at line 14637 of file json.hpp.

◆ operator!= [2/3]

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

compares JSON pointer and string for inequality

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

Definition at line 14646 of file json.hpp.

◆ operator!= [3/3]

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

compares string and JSON pointer for inequality

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

Definition at line 14655 of file json.hpp.

◆ 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 13804 of file json.hpp.

◆ 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 13819 of file json.hpp.

◆ 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 13812 of file json.hpp.

◆ operator<

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

compares two JSON pointer for less-than

Definition at line 14662 of file json.hpp.

◆ operator<<

template<typename RefStringType >
std::ostream& operator<< ( std::ostream &  o,
const json_pointer< RefStringType > &  ptr 
)
friend

write string representation of the JSON pointer to stream

See also
https://json.nlohmann.me/api/basic_json/operator_ltlt/

Definition at line 13770 of file json.hpp.

◆ operator== [1/3]

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

compares two JSON pointers for equality

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

Definition at line 14612 of file json.hpp.

◆ operator== [2/3]

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

compares JSON pointer and string for equality

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

Definition at line 14621 of file json.hpp.

◆ operator== [3/3]

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

compares string and JSON pointer for equality

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

Definition at line 14630 of file json.hpp.


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