Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
nlohmann::json_pointer< BasicJsonType > Class Template Reference

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

+ Collaboration diagram for nlohmann::json_pointer< BasicJsonType >:

Public Member Functions

const std::string & back () const
 return last reference token More...
 
bool empty () const noexcept
 return whether pointer points to the root document More...
 
 json_pointer (const std::string &s="")
 create JSON pointer More...
 
 operator std::string () 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/= (std::size_t array_idx)
 append an array index at the end of this JSON pointer More...
 
json_pointer & operator/= (std::string token)
 append an unescaped reference token 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...
 
void push_back (const std::string &token)
 append an unescaped token at the end of the reference pointer More...
 
void push_back (std::string &&token)
 append an unescaped token at the end of the reference pointer More...
 
std::string to_string () const
 return a string representation of the JSON pointer More...
 

Friends

template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer, class BinaryType >
class basic_json
 
bool operator!= (json_pointer const &lhs, json_pointer const &rhs) noexcept
 compares two JSON pointers 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, std::string token)
 create a new JSON pointer by appending the unescaped token at the end of the JSON pointer More...
 
bool operator== (json_pointer const &lhs, json_pointer const &rhs) noexcept
 compares two JSON pointers for equality More...
 

Detailed Description

template<typename BasicJsonType>
class nlohmann::json_pointer< BasicJsonType >

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 BasicJsonType >
nlohmann::json_pointer< BasicJsonType >::json_pointer ( const std::string &  s = "")
explicit

Member Function Documentation

◆ back()

template<typename BasicJsonType >
const std::string & nlohmann::json_pointer< BasicJsonType >::back ( ) const

return last reference token

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

◆ empty()

template<typename BasicJsonType >
bool nlohmann::json_pointer< BasicJsonType >::empty ( ) const
noexcept

return whether pointer points to the root document

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

◆ operator std::string()

template<typename BasicJsonType >
nlohmann::json_pointer< BasicJsonType >::operator std::string ( ) const

return a string representation of the JSON pointer

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

◆ operator/=() [1/3]

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

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 BasicJsonType >
json_pointer & nlohmann::json_pointer< BasicJsonType >::operator/= ( std::size_t  array_idx)

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 BasicJsonType >
json_pointer & nlohmann::json_pointer< BasicJsonType >::operator/= ( std::string  token)

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 BasicJsonType >
json_pointer nlohmann::json_pointer< BasicJsonType >::parent_pointer ( ) const

returns the parent of this JSON pointer

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

◆ pop_back()

template<typename BasicJsonType >
void nlohmann::json_pointer< BasicJsonType >::pop_back ( )

remove last reference token

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

◆ push_back() [1/2]

template<typename BasicJsonType >
void nlohmann::json_pointer< BasicJsonType >::push_back ( const std::string &  token)

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 BasicJsonType >
void nlohmann::json_pointer< BasicJsonType >::push_back ( std::string &&  token)

append an unescaped token at the end of the reference pointer

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

◆ to_string()

Friends And Related Function Documentation

◆ operator!=

template<typename BasicJsonType >
bool operator!= ( json_pointer< BasicJsonType > const &  lhs,
json_pointer< BasicJsonType > 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.

◆ operator/ [1/3]

template<typename BasicJsonType >
json_pointer operator/ ( const json_pointer< BasicJsonType > &  lhs,
const json_pointer< BasicJsonType > &  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/

◆ operator/ [2/3]

template<typename BasicJsonType >
json_pointer operator/ ( const json_pointer< BasicJsonType > &  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/

◆ operator/ [3/3]

template<typename BasicJsonType >
json_pointer operator/ ( const json_pointer< BasicJsonType > &  lhs,
std::string  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/

◆ operator==

template<typename BasicJsonType >
bool operator== ( json_pointer< BasicJsonType > const &  lhs,
json_pointer< BasicJsonType > 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.