34 {
"String Key",
"Hello"},
37 {
"Int Array", {1, 2, 3}},
38 {
"Double Array", {1.2, 2.3, 3.4}},
39 {
"String Array", {
"Hello1",
"Hello2",
"Hello3"}},
40 {
"Large Array", std::array<int, 10>{} },
41 {
"Large String", std::string(63,
'\0') },
42 {
"String Array 10", std::array<std::string, 10>{}},
44 {
"Large String Array 10", std::array<std::string, 10>{std::string(63,
'\0')}}
54 std::cout << o2 << std::endl;
58 int i = o[
"Int32 Key"];
61 o[
"Int32 Key"] *= 1.3;
62 std::cout <<
"Should be 57: " << o[
"Int32 Key"] << std::endl;
65 o[
"Bool Key"] =
false;
66 o[
"Bool Key"] = !o[
"Bool Key"];
69 o[
"Subdir"][
"Subsub"][
"String Key"] =
"Hello";
70 std::string s = o[
"Subdir"][
"Subsub"][
"String Key"];
72 o[
"Subdir"][
"Subsub"][
"String Key"] = s;
75 std::vector<int> v = o[
"Int Array"];
76 std::fill(v.begin(), v.end(), 10);
78 o[
"Int Array"][1] = 2;
79 i = o[
"Int Array"][1];
84 std::vector<std::string> sv;
85 sv = o[
"String Array"];
87 o[
"String Array"] = sv;
88 o[
"String Array"][2] =
"Another String";
92 for (
int e : o[
"Int Array"])
94 std::cout <<
"Sum should be 27: " << sum << std::endl;
101 std::cout << oi << std::endl;
103 std::cout << oi << std::endl;
105 std::cout << oi << std::endl;
109 ot.
connect(
"/Test/Settings/OTF");
111 ot[
"Double Key"] = 1.23;
112 ot[
"String Key"] =
"Hello";
113 ot[
"Int Array"] = std::array<int, 10>{};
114 ot[
"Subdir"][
"Int32 Key"] = 42;
115 ot[
"String Array"] = std::vector<std::string>{
"S1",
"S2",
"S3"};
118 i = ot[
"Int32 Key"](123);
119 i = ot[
"New Int32 Key"](123);
120 std::string s1 = ot[
"New String Key"](
"Hi");
121 std::cout << ot << std::endl;
124 std::cout << o.
print() << std::endl;
128 std::cout << oit.get_name() << std::endl;
131 std::cout << o.
print() << std::endl;
134 std::cout << o.
dump() << std::endl;
142 std::cout <<
"Value of key \"" + o.
get_full_path() +
"\" changed to " << o << std::endl;