JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
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.
 
mapped_typemapped () const
 Returns a non-const reference to the mapped_type member of the element.
 

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 1023 of file value.hpp.

Member Typedef Documentation

◆ key_type

The key type of the object.

Definition at line 1027 of file value.hpp.

◆ mapped_type

The mapped type of the object.

Definition at line 1030 of file value.hpp.

Constructor & Destructor Documentation

◆ object_node_handle()

jsonv::object_node_handle::object_node_handle ( )
inlineexplicitnoexcept

Definition at line 1033 of file value.hpp.

Member Function Documentation

◆ empty()

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

Definition at line 1044 of file value.hpp.

◆ key()

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()

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.

◆ operator bool()

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

Definition at line 1047 of file value.hpp.

Friends And Related Symbol Documentation

◆ value

friend class value
friend

Definition at line 1065 of file value.hpp.


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