#include "JsonUtils.h" #include void loadAllJsonsFromDirectory(Framework::Text path, std::function action) { if (path.hatAt(path.getLength() - 1, "/") || path.hatAt(path.getLength() - 1, "\\")) { path.remove(path.getLength() - 1, path.getLength()); } Framework::Datei dir(path); if (dir.istOrdner()) { Framework::RCArray *list = dir.getDateiListe(); for (Framework::Text* name : *list) { Framework::Text nextPath = path + "/" + *name; loadAllJsonsFromDirectory(nextPath, action); } list->release(); } else if (path.hatAt(path.getLength() - 5, ".json") && dir.existiert()) { Framework::JSON::JSONValue* value = Framework::JSON::loadJSONFromFile(path); if (value) { action(value, path); value->release(); } } }