27 .include_space =
true,
37 .include_space =
true,
47 .include_space =
false,
60 typename TFindChildrenFunc,
67 TLabelFunc label_func,
68 TFindChildrenFunc find_children_func,
69 TPrintFunc print_func,
71 const std::string& a_indent =
"",
76 const auto children = find_children_func(item);
77 const auto label = label_func(item);
78 const auto is_root = style.root_special && index == 0;
80 std::string indent = a_indent;
88 print_func(indent + std::string{ last ? style.l : style.t_cross } +label);
90 if ( style.include_space && last && children.empty())
95 indent += (last ? style.space : style.down);
98 for (
auto it = children.begin(); it != children.end(); ++it)
100 print_hierarchy<T, TLabelFunc, TFindChildrenFunc, TPrintFunc>
109 it + 1 == children.end()
TreeStyle determine_style()
void print_hierarchy(T item, TLabelFunc label_func, TFindChildrenFunc find_children_func, TPrintFunc print_func, const TreeStyle &style=determine_style(), const std::string &a_indent="", int index=0, bool last=true)
constexpr TreeStyle slash_style
constexpr TreeStyle utf8_tree_style
constexpr TreeStyle cross_style