|
Orcus
|
#include <json_document_tree.hpp>
Public Member Functions | |
| node (const node &other) | |
| node (node &&rhs) | |
| node & | operator= (const node &other) |
| node & | operator= (const detail::init::node &v) |
| node | operator[] (std::string_view key) |
| node | child (size_t index) |
| node | child (std::string_view key) |
| node | parent () |
| node | back () |
| void | push_back (const detail::init::node &v) |
Public Member Functions inherited from orcus::json::const_node | |
| const_node (const const_node &other) | |
| const_node (const_node &&rhs) | |
| node_t | type () const |
| size_t | child_count () const |
| std::vector< std::string_view > | keys () const |
| std::string_view | key (size_t index) const |
| bool | has_key (std::string_view key) const |
| const_node | child (size_t index) const |
| const_node | child (std::string_view key) const |
| const_node | parent () const |
| const_node | back () const |
| std::string_view | string_value () const |
| double | numeric_value () const |
| const_node & | operator= (const const_node &other) |
| const_node & | operator= (const_node &&other) |
| uintptr_t | identity () const |
| const_node_iterator | begin () const |
| const_node_iterator | end () const |
Friends | |
| class | document_tree |
Additional Inherited Members | |
Protected Member Functions inherited from orcus::json::const_node | |
| const_node (const document_tree *doc, json_value *jv) | |
| const_node (std::unique_ptr< impl > &&p) | |
Protected Attributes inherited from orcus::json::const_node | |
| std::unique_ptr< impl > | mp_impl |
Each node instance represents a JSON value stored in the document tree. This class allows mutable operations.
| node orcus::json::node::back | ( | ) |
Get the last child node.
| orcus::json::document_error | if the node is not of array type or node has no children. |
| node orcus::json::node::child | ( | size_t | index | ) |
Get a child node by index.
| index | 0-based index of a child node. |
| orcus::json::document_error | if the node is not one of the object or array types. |
| std::out_of_range | if the index is equal to or greater than the number of child nodes that the node has. |
| node orcus::json::node::child | ( | std::string_view | key | ) |
Get a child node by textural key value.
| key | textural key value to get a child node by. |
| orcus::json::document_error | if the node is not of the object type, or the node doesn't have the specified key. |
| node orcus::json::node::parent | ( | ) |
Get the parent node.
| orcus::json::document_error | if the node doesn't have a parent node which implies that the node is a root node. |
| void orcus::json::node::push_back | ( | const detail::init::node & | v | ) |
Append a new node value to the end of the array.
| orcus::json::document_error | if the node is not of array type. |
| v | new node value to append to the end of the array. |