Mercurial > minori
diff include/core/filesystem.h @ 404:e561b7542b7b
*: fix build on mac os x
| author | Paper <paper@tflc.us> |
|---|---|
| date | Mon, 19 Jan 2026 20:50:40 -0500 |
| parents | 963047512d34 |
| children |
line wrap: on
line diff
--- a/include/core/filesystem.h Mon Nov 10 15:51:45 2025 -0500 +++ b/include/core/filesystem.h Mon Jan 19 20:50:40 2026 -0500 @@ -3,6 +3,7 @@ #include <filesystem> #include <functional> #include <string> +#include <unordered_map> namespace Filesystem { @@ -13,6 +14,15 @@ std::filesystem::path GetTorrentsPath(); // (dotpath)/torrents/... std::filesystem::path GetAnimePostersPath(); // (dotpath)/anime/posters/ +struct PathHash { + auto operator()(const std::filesystem::path &p) const noexcept { + return std::filesystem::hash_value(p); + } +}; + +template<typename T> +using PathMap = std::unordered_map<std::filesystem::path, T, PathHash>; + /* ------------------------------------------------------------------------ */ /* Filesystem watcher interface. This is implemented differently on * different platforms :) */
