Class zmbt::JsonNode¶
Mutator/accessor wrapper over shared JSON value. More...
#include <json_node.hpp>
Public Functions¶
Type | Name |
---|---|
JsonNode (std::shared_ptr< boost::json::value > root) |
|
JsonNode () |
|
JsonNode (boost::json::storage_ptr sp) |
|
JsonNode (JsonNode const & o) |
|
JsonNode (JsonNode & o) |
|
JsonNode (JsonNode && o) |
|
JsonNode (boost::json::value const & v) |
|
JsonNode (boost::json::value && v) |
|
boost::json::array const & | as_array () const |
boost::json::array & | as_array () |
boost::json::object const & | as_object () const |
boost::json::object & | as_object () |
boost::json::value const & | at (boost::json::string_view json_ptr) const |
boost::json::value const & | at (boost::json::string_view fmtstr, T && first, A &&... rest) const |
JsonNode | branch (boost::json::kind kind, boost::json::string_view subnode_ptr) create JsonNode proxy over subnode |
JsonNode | branch (boost::json::string_view subnode_ptr) |
JsonNode | branch (boost::json::kind kind, boost::json::string_view fmtstr, T && first, A &&... rest) |
JsonNode | branch (boost::json::string_view fmtstr, T && first, A &&... rest) |
bool | contains (boost::json::string_view json_ptr) const |
bool | contains (boost::json::string_view fmtstr, T && first, A &&... rest) const |
JsonNode | copy () const |
boost::json::value const * | find_pointer (boost::json::string_view json_ptr) const |
boost::json::value const * | find_pointer (boost::json::string_view fmtstr, T && first, A &&... rest) const |
boost::json::value * | find_pointer (boost::json::string_view fmtstr, T && first, A &&... rest) |
boost::json::array & | get_or_create_array (boost::json::string_view json_ptr="") |
boost::json::array & | get_or_create_array (boost::json::string_view fmtstr, T && first, A &&... rest) |
boost::json::object & | get_or_create_object (boost::json::string_view json_ptr="") |
boost::json::object & | get_or_create_object (boost::json::string_view fmtstr, T && first, A &&... rest) |
boost::json::value | get_or_default (boost::json::string_view json_ptr, boost::json::value const & dflt) const |
bool | is_null () const |
boost::json::value const * | node (boost::json::error_code & ec) const |
boost::json::value * | node (boost::json::error_code & ec) |
boost::json::value const & | node () const |
boost::json::value & | node () |
boost::json::string_view | node_ptr () const |
boost::json::value & | operator() (boost::json::string_view json_ptr="") |
boost::json::value & | operator() (boost::json::string_view fmtstr, T && first, A &&... rest) |
boost::json::value const & | operator() (boost::json::string_view json_ptr="") const |
boost::json::value const & | operator() (boost::json::string_view fmtstr, T && first, A &&... rest) const |
JsonNode & | operator= (JsonNode const &) = default |
JsonNode & | operator= (JsonNode &&) = default |
std::shared_ptr< boost::json::value > const & | root () const |
std::size_t | size () const |
~JsonNode () noexcept |
Detailed Description¶
Provides read/write access to the referenced value internal structure via JSON Pointer. Each instance owns a shared pointer to the root value, so subnode proxies may prolong original object lifetime.
Additions to the standard JSON Pointer syntax: At-the-end token: '@'. Points to the last element of an array. Queries with at-the-end token always results in creating a new node on empty array. Past-the-end token: '+'. Points to the new element of an array. Queries with past-the-end token always results in creating a new node.
The rules for the additional tokens are:
For each @ token * if the node is null, the token substituted with 0; otherwise * if the node is an empty array, the token substituted with 0; otherwise * if the node is a non-empty array, the token substituted with node size - 1; otherwise * an error is produced.
For each + token * if the node is null, the token substituted with 0; otherwise * if the node is an array, the token substituted with node size; otherwise * an error is produced.
Public Functions Documentation¶
function JsonNode [2/9]¶
function JsonNode [3/9]¶
function JsonNode [4/9]¶
function JsonNode [5/9]¶
function JsonNode [6/9]¶
function JsonNode [7/9]¶
function JsonNode [8/9]¶
function JsonNode [9/9]¶
function as_array [1/2]¶
function as_array [2/2]¶
function as_object [1/2]¶
function as_object [2/2]¶
function at [1/2]¶
function at [2/2]¶
template<class T, class... A>
inline boost::json::value const & zmbt::JsonNode::at (
boost::json::string_view fmtstr,
T && first,
A &&... rest
) const
function branch [1/4]¶
create JsonNode proxy over subnode
function branch [2/4]¶
function branch [3/4]¶
template<class T, class... A>
inline JsonNode zmbt::JsonNode::branch (
boost::json::kind kind,
boost::json::string_view fmtstr,
T && first,
A &&... rest
)
function branch [4/4]¶
template<class T, class... A>
inline JsonNode zmbt::JsonNode::branch (
boost::json::string_view fmtstr,
T && first,
A &&... rest
)
function contains [1/2]¶
function contains [2/2]¶
template<class T, class... A>
inline bool zmbt::JsonNode::contains (
boost::json::string_view fmtstr,
T && first,
A &&... rest
) const
function copy¶
function find_pointer [1/3]¶
inline boost::json::value const * zmbt::JsonNode::find_pointer (
boost::json::string_view json_ptr
) const
function find_pointer [2/3]¶
template<class T, class... A>
inline boost::json::value const * zmbt::JsonNode::find_pointer (
boost::json::string_view fmtstr,
T && first,
A &&... rest
) const
function find_pointer [3/3]¶
template<class T, class... A>
inline boost::json::value * zmbt::JsonNode::find_pointer (
boost::json::string_view fmtstr,
T && first,
A &&... rest
)
function get_or_create_array [1/2]¶
inline boost::json::array & zmbt::JsonNode::get_or_create_array (
boost::json::string_view json_ptr=""
)
function get_or_create_array [2/2]¶
template<class T, class... A>
inline boost::json::array & zmbt::JsonNode::get_or_create_array (
boost::json::string_view fmtstr,
T && first,
A &&... rest
)
function get_or_create_object [1/2]¶
inline boost::json::object & zmbt::JsonNode::get_or_create_object (
boost::json::string_view json_ptr=""
)
function get_or_create_object [2/2]¶
template<class T, class... A>
inline boost::json::object & zmbt::JsonNode::get_or_create_object (
boost::json::string_view fmtstr,
T && first,
A &&... rest
)
function get_or_default¶
inline boost::json::value zmbt::JsonNode::get_or_default (
boost::json::string_view json_ptr,
boost::json::value const & dflt
) const
function is_null¶
function node [1/4]¶
function node [2/4]¶
function node [3/4]¶
function node [4/4]¶
function node_ptr¶
function operator() [1/4]¶
function operator() [2/4]¶
template<class T, class... A>
inline boost::json::value & zmbt::JsonNode::operator() (
boost::json::string_view fmtstr,
T && first,
A &&... rest
)
function operator() [3/4]¶
inline boost::json::value const & zmbt::JsonNode::operator() (
boost::json::string_view json_ptr=""
) const
function operator() [4/4]¶
template<class T, class... A>
inline boost::json::value const & zmbt::JsonNode::operator() (
boost::json::string_view fmtstr,
T && first,
A &&... rest
) const
function operator=¶
function operator=¶
function root¶
function size¶
function ~JsonNode¶
Friends Documentation¶
friend operator<<¶
The documentation for this class was generated from the following file zmbt-framework/zmbt-framework/backends/cxx/include/zmbt/core/json_node.hpp