|
|
|
@ -99,12 +99,17 @@ void archive::parse_json(const std::string& json_data) {
|
|
|
|
|
|
|
|
|
|
// Process all keys in the JSON object
|
|
|
|
|
for (auto& [key, value] : data.items()) {
|
|
|
|
|
if (json_map.find(key) != json_map.end()) {
|
|
|
|
|
json_map[key](value);
|
|
|
|
|
json_map.erase(key);
|
|
|
|
|
} else if (readonly_map.find(key) != readonly_map.end()) {
|
|
|
|
|
readonly_map[key](value);
|
|
|
|
|
readonly_map.erase(key);
|
|
|
|
|
try {
|
|
|
|
|
if (json_map.find(key) != json_map.end()) {
|
|
|
|
|
json_map[key](value);
|
|
|
|
|
json_map.erase(key);
|
|
|
|
|
} else if (readonly_map.find(key) != readonly_map.end()) {
|
|
|
|
|
readonly_map[key](value);
|
|
|
|
|
readonly_map.erase(key);
|
|
|
|
|
}
|
|
|
|
|
} catch (const std::exception& e) {
|
|
|
|
|
std::cerr << "Unexpected error during JSON parsing: " << e.what() << std::endl;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|