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

Public Member Functions

 walker (const walker &other)
 
void root ()
 
void descend (size_t child_pos)
 
void ascend ()
 
size_t child_count () const
 
node_properties get_node () const
 
std::vector< std::string > build_field_paths () const
 
std::string build_row_group_path () const
 

Friends

class structure_tree
 

Member Function Documentation

◆ ascend()

void orcus::json::structure_tree::walker::ascend ( )

Move up to the parent node of the current node.

◆ build_field_paths()

std::vector< std::string > orcus::json::structure_tree::walker::build_field_paths ( ) const

Build one or more field paths for the current value node. For a value node that is a child of an object, you'll always get one path, whereas a value node that is a chlid of an array, you may get more than one field paths.

Returns
one or more field paths built for the current value node.

◆ build_row_group_path()

std::string orcus::json::structure_tree::walker::build_row_group_path ( ) const

Build a path for the parent of the current repeating node. A row group is an anchor to which repeating nodes get anchored to. It is used to determine when to increment row position during mapping.

Returns
path for the row group of the current repeating node.

◆ child_count()

size_t orcus::json::structure_tree::walker::child_count ( ) const

Return the number of child nodes the current node has.

Returns
number of child nodes of the current node.

◆ descend()

void orcus::json::structure_tree::walker::descend ( size_t  child_pos)

Move down to a child node at specified position. Call child_count() to get the number of child nodes the current node has. A child node position is 0-based and must be less than the child count.

Parameters
child_pos0-based index of the child node to move down to.

◆ get_node()

node_properties orcus::json::structure_tree::walker::get_node ( ) const

Get the properties of the current node.

◆ root()

void orcus::json::structure_tree::walker::root ( )

Set the current position to the root node, and return its properties.