|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Thread-safe cache for Proton version scanning results. More...
#include <proton_cache.h>
Static Public Member Functions | |
| static int | getCacheAge () |
| Get cache age in seconds. | |
| static std::vector< std::string > | getSortedVersionNames () |
| Get sorted Proton version names only. | |
| static std::vector< std::pair< std::string, std::filesystem::path > > | getVersions () |
| Get cached Proton versions. | |
| static void | invalidate () |
| Invalidate the cache. | |
| static bool | isValid () |
| Check if cache is currently valid. | |
Thread-safe cache for Proton version scanning results.
Caches the results of expensive Proton version scans to avoid repeated filesystem traversal. Cache automatically invalidates after a configurable time period or can be manually invalidated.
All methods are thread-safe via mutex protection.
Cache invalidates automatically after PROTON_CACHE_VALIDITY_SEC seconds. Can also be manually invalidated via invalidate().
Definition at line 47 of file proton_cache.h.
|
static |
Get cache age in seconds.
Definition at line 102 of file proton_cache.cpp.
|
static |
Get sorted Proton version names only.
Convenience method that returns just the names in sorted order:
Definition at line 42 of file proton_cache.cpp.
References getVersions().
|
static |
Get cached Proton versions.
Returns cached results if cache is valid, otherwise rescans filesystem and updates cache. Thread-safe.
Definition at line 29 of file proton_cache.cpp.
Referenced by getSortedVersionNames().
|
static |
Invalidate the cache.
Forces a rescan on next getVersions() call. Use this when:
Definition at line 88 of file proton_cache.cpp.
References Logger::info().
Referenced by RunnerDownloadService::downloadRunner(), and RunnerDownloadService::uninstallRunner().
|
static |
Check if cache is currently valid.
Definition at line 96 of file proton_cache.cpp.