You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an array of etude each of which contains a name, a json array of "critere exclusion" and a json array of "critere inclusion".
The problem is reading the file.
I get the first array which i iterate with for (auto& p : jsonObject), it runs okay untill
else if (it.key() == "criteres inclusion")
However even tho this condition succeds, i can't retrieve the array associated with this key.
I've tried
auto jsonArrayCritIncl = it.value();
and auto jsonArrayCritIncl = it.value().get<json::array>();
nothing works, could you please help me ?
using json = nlohmann::json;
json jsonObject = json::parse(finLoad);
for (auto& p : jsonObject)
{
std::string mystr;
Etude uneEtude;
for (auto it = p.begin(); it != p.end(); ++it)
{
if (it.key() == "_nom etude")
{
mystr = it.value().get<std::string>();
uneEtude._nom = QString::fromStdString(mystr);
}
else if (it.key() == "criteres inclusion")
{
//
auto jsonArrayCritIncl = it.value();
for (auto const& k : jsonArrayCritIncl)
{
//Do stuff
}
}
}
}
}
}
The text was updated successfully, but these errors were encountered:
Hi,
I've spent a few hours on this and I read full doc.
I store my data fine using this code
I get a good file, such as this one :
I get an array of etude each of which contains a name, a json array of "critere exclusion" and a json array of "critere inclusion".
The problem is reading the file.
I get the first array which i iterate with for (auto& p : jsonObject), it runs okay untill
The text was updated successfully, but these errors were encountered: