27 #ifndef INCLUDED_FILE_CACHE 28 #define INCLUDED_FILE_CACHE 66 shared_ptr<u8>
Reserve(
size_t size);
82 void Add(
const VfsPath& pathname,
const shared_ptr<u8>& data,
size_t size,
size_t cost = 1);
101 bool Retrieve(
const VfsPath& pathname, shared_ptr<u8>& data,
size_t& size);
105 shared_ptr<Impl>
impl;
108 #endif // #ifndef INCLUDED_FILE_CACHE Definition: file_cache.cpp:157
bool Retrieve(const VfsPath &pathname, shared_ptr< u8 > &data, size_t &size)
Attempt to retrieve a file's contents from the file cache.
Definition: file_cache.cpp:250
cache of file contents with support for zero-copy IO.
Definition: file_cache.h:48
shared_ptr< Impl > impl
Definition: file_cache.h:104
void Remove(const VfsPath &pathname)
Remove a file's contents from the cache (if it exists).
Definition: file_cache.cpp:245
shared_ptr< u8 > Reserve(size_t size)
Reserve a chunk of the cache's memory region.
Definition: file_cache.cpp:235
void Add(const VfsPath &pathname, const shared_ptr< u8 > &data, size_t size, size_t cost=1)
Add a file's contents to the cache.
Definition: file_cache.cpp:240
FileCache(size_t size)
Definition: file_cache.cpp:230