JSON Voorhees
Killer JSON for C++
jsonv::object_node_handle Class Referencefinal

A node handle used when a value is kind::object to access elements of the object in potentially destructive manner. More...

#include <jsonv/value.hpp>

Public Types

using key_type = std::string
 The key type of the object.
 
using mapped_type = value
 The mapped type of the object.
 

Public Member Functions

 object_node_handle (object_node_handle &&) noexcept
 
object_node_handleoperator= (object_node_handle &&) noexcept
 
bool empty () const noexcept
 
 operator bool () const noexcept
 
key_typekey () const
 Returns a non-const reference to the key_type member of the element. More...
 
mapped_typemapped () const
 Returns a non-const reference to the mapped_type member of the element. More...
 

Friends

class value
 

Detailed Description

A node handle used when a value is kind::object to access elements of the object in potentially destructive manner.

This makes it possible to modify the contents of a node extracted from an object, and then re-insert it without having to copy the element.

Definition at line 1049 of file value.hpp.

Member Function Documentation

bool jsonv::object_node_handle::empty ( ) const
inlinenoexcept
Returns
true if the node handle is empty; false if otherwise.

Definition at line 1070 of file value.hpp.

key_type& jsonv::object_node_handle::key ( ) const

Returns a non-const reference to the key_type member of the element.

Exceptions
std::invalid_argumentif the node handle is empty.
mapped_type& jsonv::object_node_handle::mapped ( ) const

Returns a non-const reference to the mapped_type member of the element.

Exceptions
std::invalid_argumentif the node handle is empty.
jsonv::object_node_handle::operator bool ( ) const
inlineexplicitnoexcept
Returns
false if the node handle is empty; true if otherwise.

Definition at line 1073 of file value.hpp.


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