class CacheDir
Defined at line 15 of file ../../src/developer/debug/zxdb/common/cache_dir.h
A cache directory automatically removes least recently used files when its size exceeds the
maximum size. More sophisticated features could be added in the future.
Public Members
static const uint64_t kDefaultMaxSize
Public Methods
const std::filesystem::path & path ()
Defined at line 25 of file ../../src/developer/debug/zxdb/common/cache_dir.h
void CacheDir (std::filesystem::path dir, uint64_t max_size_bytes)
Declare a cache directory with the maximum size in bytes. When the size of the cache directory
is larger than the max_size_bytes, an LRU pruning will be triggered. A value of 0 disables the
cache pruning.
Defined at line 32 of file ../../src/developer/debug/zxdb/common/cache_dir.cc
void NotifyFileAccess (const std::filesystem::path & file)
The caller of this class is able to access, create files in the cache directory directly but
needs to notify us about the access.
If the file is not in the cache_dir, this function does nothing.
It's guaranteed that the file won't be deleted by this call.
Defined at line 49 of file ../../src/developer/debug/zxdb/common/cache_dir.cc