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"
19 namespace orcus {
namespace json {
23 std::vector<std::string> paths;
24 std::vector<std::string> row_groups;
30 std::unique_ptr<impl> mp_impl;
34 enum class node_type : short { unknown = 0,
array = 1,
object = 2, object_key = 3, value = 4 };
47 std::unique_ptr<impl> mp_impl;
49 walker(
const structure_tree::impl* parent_impl);
69 void descend(
size_t child_pos);
81 size_t child_count()
const;
96 std::vector<std::string> build_field_paths()
const;
105 std::string build_row_group_path()
const;
114 void parse(
const char* p,
size_t n);
120 void normalize_tree();
122 void dump_compact(std::ostream& os)
const;
124 walker get_walker()
const;
126 using range_handler_type = std::function<void(
table_range_t&&)>;
128 void process_ranges(range_handler_type rh)
const;
131 ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, structure_tree::node_type nt);