summaryrefslogtreecommitdiff
path: root/filecache.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-01-20 02:26:04 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2021-01-20 02:26:04 -0500
commitbafd2fa25ab4b5e11ab30f2679a8df91caf027bf (patch)
treea6b2c516d1bbf4bc596e1c42a542c02a93de38c2 /filecache.cpp
parentdda203376d472daf288f4721644ad14ee11c3a84 (diff)
downloadabaddon-portaudio-bafd2fa25ab4b5e11ab30f2679a8df91caf027bf.tar.gz
abaddon-portaudio-bafd2fa25ab4b5e11ab30f2679a8df91caf027bf.zip
add menu item to clear image cache
Diffstat (limited to 'filecache.cpp')
-rw-r--r--filecache.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/filecache.cpp b/filecache.cpp
index 9f9f718..c0b2f36 100644
--- a/filecache.cpp
+++ b/filecache.cpp
@@ -17,6 +17,11 @@ Cache::~Cache() {
fprintf(stderr, "error removing tmp dir\n");
}
+void Cache::ClearCache() {
+ for (const auto &path : std::filesystem::directory_iterator(m_tmp_path))
+ std::filesystem::remove_all(path);
+}
+
std::string Cache::GetCachedName(std::string str) {
uint32_t out;
MurmurHash3_x86_32(str.c_str(), str.size(), 0, &out);