TerraForge3D  2.3.1
3D Terrain And Landscape Generator
nlohmann::json_pointer< BasicJsonType > Class Template Reference

JSON Pointer. More...

Public Member Functions

 json_pointer (const std::string &s="")
 create JSON pointer More...
 
std::string to_string () const
 return a string representation of the JSON pointer More...
 
 operator std::string () 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/= (std::string 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 std::string & back () const
 return 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...
 
bool empty () const noexcept
 return whether pointer points to the root document More...
 

Private Member Functions

JSON_PRIVATE_UNLESS_TESTED JSON pointer has no BasicJsonType ()))
 
BasicJsonType & get_and_create (BasicJsonType &j) const
 create and return a reference to the pointed to value More...
 
BasicJsonType & get_unchecked (BasicJsonType *ptr) const
 return a reference to the pointed to value More...
 
BasicJsonType & get_checked (BasicJsonType *ptr) const
 
const BasicJsonType & get_unchecked (const BasicJsonType *ptr) const
 return a const reference to the pointed to value More...
 
const BasicJsonType & get_checked (const BasicJsonType *ptr) const
 
bool contains (const BasicJsonType *ptr) const
 

Static Private Member Functions

static BasicJsonType::size_type array_index (const std::string &s)
 
static std::vector< std::string > split (const std::string &reference_string)
 split the string input to reference tokens More...
 
static void flatten (const std::string &reference_string, const BasicJsonType &value, BasicJsonType &result)
 
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_pointer result = *this
 
result reference_tokens = {reference_tokens[0]}
 
return result
 
std::vector< std::string > reference_tokens
 the reference tokens More...
 

Friends

class basic_json
 
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 &ptr, std::string 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 &ptr, std::size_t array_idx)
 create a new JSON pointer by appending the array-index-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...
 
bool operator!= (json_pointer const &lhs, json_pointer const &rhs) noexcept
 compares two JSON pointers for inequality More...
 

Detailed Description

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

JSON Pointer.

A JSON pointer defines a string syntax for identifying a specific value within a JSON document. It can be used with functions at and operator[]. Furthermore, JSON pointers are the base for JSON patches.

See also
RFC 6901
Since
version 2.0.0

Definition at line 12563 of file json.hpp.


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