subtree

Defined in header: <orcus/json_document_tree.hpp>

class subtree

References a subtree structure of an existing document_tree instance.

Note

Instance of this class is movable but not copyable.

Note

Instance of this class can only reference the source document; it becomes invalid when the source document is modified or destroyed.

Public Functions

subtree()
subtree(const document_tree &src, std::string_view path)

Creates a subtree reference of a source document.

Parameters:
  • src – Source document instance.

  • path – JSONPath expression referencing the root of a subtree in the source document.

subtree(const subtree&) = delete
subtree(subtree &&other)
~subtree()
subtree &operator=(subtree &&other)
std::string dump(std::size_t indent) const

Dump the subtree to a string.

Parameters:

indent – Number of whitespace characters to use for one indent level. Note that specifying the indent value of 0 will generate output without line breaks.

Returns:

String representation of the subtree.