|
|
|
|
101
|
|
101
|
|
102
|
DKVariant prop = DKVariant::TypePairs;
|
102
|
DKVariant prop = DKVariant::TypePairs;
|
103
|
|
103
|
|
104
|
- DKVariant::VPairs& root = prop.Pairs();
|
|
|
105
|
- DKVariant::VPairs& sub1 = root.Value("Sub1").Pairs();
|
|
|
106
|
- DKVariant::VPairs& sub1ss1 = sub1.Value("SS1").Pairs();
|
|
|
107
|
- DKVariant::VPairs& sub1ss2 = sub1.Value("SS2").Pairs();
|
|
|
108
|
- DKVariant::VPairs& sub1ss3 = sub1.Value("SS3").Pairs();
|
|
|
109
|
-
|
|
|
110
|
- DKVariant::VPairs& sub2 = root.Value("Sub2").Pairs();
|
|
|
111
|
- DKVariant::VPairs& sub2ss1 = sub2.Value("SS1").Pairs();
|
|
|
112
|
- DKVariant::VPairs& sub2ss2 = sub2.Value("SS2").Pairs();
|
|
|
113
|
- DKVariant::VPairs& sub2ss2hid = sub2ss2.Value("").Pairs();
|
|
|
114
|
- sub2ss2hid.Value("VV2").String() = "hidden";
|
|
|
115
|
-
|
|
|
116
|
- sub2.Value("SS2.VV2").String() = "Better";
|
|
|
117
|
-
|
|
|
118
|
- sub2ss2.Value("VV1").Integer() = 0;
|
|
|
119
|
- sub2ss2.Value("VV2").String() = "Good";
|
|
|
120
|
-
|
|
|
121
|
- DKVariant::VPairs& sub2ss3 = sub2.Value("SS3").Pairs();
|
|
|
122
|
-
|
|
|
123
|
- DKVariant::VInteger& sub3 = root.Value("Sub3").Integer();
|
|
|
124
|
- root.Value("Sub2.SS2.VV2.KK").String() = "Bad1";
|
|
|
125
|
- root.Value("Sub2.SS2.VV2.").String() = "Bad2";
|
|
|
126
|
- root.Value("Sub2.SS2.VV2").String() = "Best";
|
|
|
127
|
-
|
|
|
|
|
104
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "1");
|
|
|
105
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "2");
|
|
|
106
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "3");
|
|
|
107
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "4");
|
|
|
108
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "5");
|
|
|
109
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "6");
|
|
|
110
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "7");
|
|
|
111
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "8");
|
|
|
112
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "9");
|
|
|
113
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "10");
|
|
|
114
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "11");
|
|
|
115
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "12");
|
|
|
116
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "13");
|
|
|
117
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "14");
|
|
|
118
|
+ prop.NewValueAtKeyPath("Root.Group1.Sub1.Container1.Item1", "15");
|
|
|
119
|
+
|
|
|
120
|
+
|
128
|
PrintVariant("ROOT", prop);
|
121
|
PrintVariant("ROOT", prop);
|
129
|
DKLog("-------------------");
|
122
|
DKLog("-------------------");
|
130
|
- DKString findKey = "Sub2.SS2.VV2";
|
|
|
|
|
123
|
+ DKString findKey = "Root.Group1.Sub1.Container1.Item1";
|
131
|
bool b = prop.FindObjectAtKeyPath(findKey, DKFunction([&](DKVariant& var)
|
124
|
bool b = prop.FindObjectAtKeyPath(findKey, DKFunction([&](DKVariant& var)
|
132
|
{
|
125
|
{
|
133
|
PrintVariant(DKString::Format("(%ls)", (const wchar_t*)findKey), var);
|
126
|
PrintVariant(DKString::Format("(%ls)", (const wchar_t*)findKey), var);
|