summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r--src/resources/resourcemanager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index e8e9f14c1..9a4d1c3f1 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -42,6 +42,7 @@
#include <SDL_image.h>
#include <cassert>
+#include <dirent.h>
#include <fstream>
#include <iostream>
#include <sstream>
@@ -1104,3 +1105,18 @@ void ResourceManager::removeDelayLoad(const AnimationDelayLoad
}
}
}
+
+void ResourceManager::deleteFilesInDirectory(std::string path)
+{
+ path += "/";
+ struct dirent *next_file;
+ DIR *dir = opendir(path.c_str());
+
+ while ((next_file = readdir(dir)))
+ {
+ const std::string file = next_file->d_name;
+ const std::string name = path + file;
+ if (file != "." && file != "..")
+ remove(name.c_str());
+ }
+}