I want to add data from multiple JSONs into a singular variable
I want to Parse JSON_1's data into the json data type, then parse JSON_2's data into the same variable, without overwriting the original data (Like an append type operator)
I have tried iterating over the files and using file >> json for each, however the data from the first JSON is overwritten by the next jsons
std::vector<std::string> cardPaths = getDir("cards/stats/", ".json");
json cardData;
std::wstring LoadMsg = L"Loaded:";
for(auto f_path : cardPaths) {
std::ifstream(f_path) >> cardData;
std::cout << f_path << "loaded successfully" << std::endl;
}
Windows 10 OS and compiler is g++ (Rev3, Built by MSYS2 project) 10.1.0
Library Version
I want to add data from multiple JSONs into a singular variable
I want to Parse JSON_1's data into the json data type, then parse JSON_2's data into the same variable, without overwriting the original data (Like an append type operator)
I have tried iterating over the files and using
file >> jsonfor each, however the data from the first JSON is overwritten by the next jsonsWindows 10 OS and compiler is g++ (Rev3, Built by MSYS2 project) 10.1.0
Library Version
developbranch