Orcus
Loading...
Searching...
No Matches
Public Member Functions | List of all members
orcus::json::subtree Class Reference

#include <json_document_tree.hpp>

Public Member Functions

 subtree (const document_tree &src, std::string_view path)
 
 subtree (const subtree &)=delete
 
 subtree (subtree &&other)
 
subtreeoperator= (subtree &&other)
 
std::string dump (std::size_t indent) const
 

Detailed Description

References a subtree structure of an existing document_tree instance.

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

Constructor & Destructor Documentation

◆ subtree()

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

Creates a subtree reference of a source document.

Parameters
srcSource document instance.
pathJSONPath expression referencing the root of a subtree in the source document.

Member Function Documentation

◆ dump()

std::string orcus::json::subtree::dump ( std::size_t indent) const

Dump the subtree to a string.

Parameters
indentNumber 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.