Hi, @Noah Aas
Example:
CStringArray PositionArray;
if (obj.HasKey (L"PositionArray")) {
JsonArray listArray = obj.GetNamedArray (L"PositionArray");
for (auto value : listArray) {
if (value.ValueType () == JsonValueType::Number) {
CString str;
#ifdef UNICODE
str.Format (L"%.0f", value.GetNumber ());
#else
str.Format ("%.0f", value.GetNumber ());
#endif
PositionArray.Add (str);
}
}
}
//std::wcout << L"PositionArray:" << std::endl;
//for (int i = 0; i < PositionArray.GetSize (); ++i) {
// std::wcout << L"- " << PositionArray[i].GetString () << std::endl;
//}
CStringArray GroupIndexArray;
if (obj.HasKey (L"GroupIndexArray")) {
JsonArray listArray = obj.GetNamedArray (L"GroupIndexArray");
for (auto value : listArray) {
if (value.ValueType () == JsonValueType::String) {
CString str (value.GetString ().c_str ());
GroupIndexArray.Add (str);
}
}
}
//std::wcout << L"GroupIndexArray:" << std::endl;
//for (int i = 0; i < GroupIndexArray.GetSize (); ++i) {
// std::wcout << L"- " << GroupIndexArray[i].GetString () << std::endl;
//}
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.