value::at_pointer
Access an element via JSON Pointer.
Synopsis
value const&
at_pointer(
string_view ptr,
boost::source_location const& loc = BOOST_CURRENT_LOCATION) const&; (1)
value&&
at_pointer(
string_view ptr,
boost::source_location const& loc = BOOST_CURRENT_LOCATION) &&; (2)
value&
at_pointer(
string_view ptr,
boost::source_location const& loc = BOOST_CURRENT_LOCATION) &; (3)
Description
This function is used to access a (potentially nested) element of the value using a JSON Pointer string.
Complexity
Linear in the sizes of ptr
and underlying array, object, or string.
Exception Safety
Strong guarantee.
Return Value
reference to the element identified by ptr
.
Return Value
reference to the element identified by ptr
.
Return Value
reference to the element identified by ptr
.
Parameters
Name | Description |
---|---|
|
JSON Pointer string. |
|
|
Exceptions
Type | Thrown On |
---|---|
|
if an error occurs. |