add menu item to clear image cache

This commit is contained in:
ouwou
2021-01-20 02:26:04 -05:00
parent dda203376d
commit bafd2fa25a
6 changed files with 18 additions and 0 deletions

View File

@@ -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);