8#ifndef INCLUDED_ORCUS_JSON_STRUCTURE_TREE_HPP
9#define INCLUDED_ORCUS_JSON_STRUCTURE_TREE_HPP
11#include "orcus/env.hpp"
12#include "orcus/types.hpp"
20namespace orcus {
namespace json {
24 std::vector<std::string> paths;
25 std::vector<std::string> row_groups;
28class ORCUS_DLLPUBLIC structure_tree
31 std::unique_ptr<impl> mp_impl;
35 enum class node_type : uint8_t { unknown = 0,
array = 1,
object = 2, object_key = 3, value = 4 };
61 using range_handler_type = std::function<void(
table_range_t&&)>;
69 class ORCUS_DLLPUBLIC walker
71 friend class structure_tree;
74 std::unique_ptr<impl> mp_impl;
76 walker(
const structure_tree::impl* parent_impl);
79 walker(
const walker& other);
135 structure_tree(
const structure_tree&) =
delete;
136 structure_tree& operator= (
const structure_tree&) =
delete;
150 void parse(std::string_view stream);
158 void dump_compact(std::ostream& os)
const;
160 walker get_walker()
const;
162 void process_ranges(range_handler_type rh)
const;
165ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, structure_tree::node_type nt);
Definition json_document_tree.hpp:387
Definition json_structure_tree.hpp:70
size_t child_count() const
void descend(size_t child_pos)
std::vector< std::string > build_field_paths() const
std::string build_row_group_path() const
node_properties get_node() const
callback_type
Definition json_structure_tree.hpp:41
void set_callback(callback_type type, callback_handler_type callback)
std::function< void(std::any)> callback_handler_type
Definition json_structure_tree.hpp:59
Definition json_structure_tree.hpp:64
Definition json_structure_tree.hpp:23