-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
33 lines (31 loc) · 987 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "TreeViewBuilder.h"
#include <iostream>
int main()
{
TreeViewBuilder builder;
auto &root = builder.addOrSetRootNode("foobar");
root.addChild("42");
auto &childB = root.addChild("9527");
auto &childB1 = childB.addChild("foo");
childB1.addChild("bar");
auto &childB1B = childB1.addChild("wakaka");
childB1B.addChild("Catchphrase!");
auto &childC = root.addChild("There are three things I love in life:");
childC.addChild("Kicking @ss");
childC.addChild("TBD");
childC.addChild("insert 3rd thing here");
using ParamT = std::pair<std::string, TreeViewBuilder::Style>;
for (const auto param : std::vector<ParamT>{
{"SIMPLE",
TreeViewBuilder::Style::SIMPLE},
{"EXPAND",
TreeViewBuilder::Style::EXPAND},
{"ARROW",
TreeViewBuilder::Style::ARROW},
})
{
root.setName("Style: " + param.first);
std::cout << builder.build(param.second, 4, 0) << std::endl;
}
return 0;
}