37 {
"String Key",
"Hello"},
40 {
"Int Array", {1, 2, 3}},
41 {
"Double Array", {1.2, 2.3, 3.4}},
42 {
"String Array", {
"Hello1",
"Hello2",
"Hello3"}},
43 {
"Large Array", std::array<int, 10>{} },
44 {
"Large String", std::string(63,
'\0') },
45 {
"String Array 10", std::array<std::string, 10>{}},
47 {
"Large String Array 10", std::array<std::string, 10>{std::string(63,
'\0')}}
57 std::cout <<
o2 << std::endl;
61 int i =
o[
"Int32 Key"];
64 o[
"Int32 Key"] *= 1.3;
65 std::cout <<
"Should be 57: " <<
o[
"Int32 Key"] << std::endl;
68 o[
"Int64 Key"] = -1LL;
70 std::cout << std::hex <<
"0x" <<
i64 << std::dec << std::endl;
72 o[
"UInt64 Key"] = 0x1234567812345678u;
74 std::cout << std::hex <<
"0x" <<
ui64 << std::dec << std::endl;
77 o[
"Bool Key"] =
false;
78 o[
"Bool Key"] = !
o[
"Bool Key"];
81 o[
"Subdir"][
"Subsub"][
"String Key"] =
"Hello";
82 std::string s =
o[
"Subdir"][
"Subsub"][
"String Key"];
84 o[
"Subdir"][
"Subsub"][
"String Key"] = s;
85 s = s +
o[
"Subdir"][
"Subsub"][
"String Key"].s();
88 std::string
substr(
"Int32 Key");
92 std::vector<int> v =
o[
"Int Array"];
93 std::fill(v.begin(), v.end(), 10);
95 o[
"Int Array"][1] = 2;
96 i =
o[
"Int Array"][1];
97 o[
"Int Array"].resize(5);
99 std::cout <<
"Arrays size is " <<
o[
"Int Array"].size() << std::endl;
102 o[
"Int Array"][10] = 10;
105 std::vector<std::string>
sv;
106 sv =
o[
"String Array"];
107 sv[1] =
"New String";
108 o[
"String Array"] =
sv;
109 o[
"String Array"][2] =
"Another String";
110 o[
"String Array"][3] = std::string(
"One more");
111 s =
o[
"String Array"][1].s();
114 o[
"String Array 2"][0].set_string_size(
"Hello", 64);
115 o[
"String Array 2"][1] =
"Second string";
116 o[
"String Array 2"][2] =
"Third string";
119 o[
"Bool Array"] = std::array<bool, 3>{
true,
false,
true};
120 o[
"Bool Array from Vector"] = std::vector<bool>{
true,
false,
true};
124 for (
int e :
o[
"Int Array"])
126 std::cout <<
"Sum should be 37: " << sum << std::endl;
133 std::cout <<
oi << std::endl;
134 oi.set_auto_refresh_read(
false);
135 std::cout <<
oi << std::endl;
137 std::cout <<
oi << std::endl;
140 oi.set_auto_refresh_write(
false);
148 ot[
"Double Key"] = 1.23;
149 ot[
"String Key"] =
"Hello";
150 ot[
"Int Array"] = std::array<int, 10>{};
151 ot[
"Subdir"][
"Int32 Key"] = 42;
152 ot[
"String Array"] = std::vector<std::string>{
"S1",
"S2",
"S3"};
153 ot[
"Other String Array"][0] =
"OSA0";
154 ot[
"Other String Array"][1] =
"OSA1";
157 i =
ot[
"Int32 Key"](123);
158 i =
ot[
"New Int32 Key"](123);
160 std::cout <<
ot << std::endl;
163 std::cout <<
o.print() << std::endl;
168 std::cout <<
oit.get_name() <<
": " <<
oit << std::endl;
171 std::cout <<
o.print() << std::endl;
174 std::cout <<
o.dump() << std::endl;
180 {
"New Bool Key",
true},
181 {
"String Array", {
"Hello1",
"Hello2",
"Hello3"}},
185 {
"New Sub Bool Key",
false},
192 std::cout <<
"After changing structure with o3:" << std::endl;
193 std::cout <<
o3.print() << std::endl;
204 std::cout <<
"Value of key \"" +
o.get_full_path() +
"\" changed to " <<
o << std::endl;
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)