openMSX
|
#include <FilePoolCore.hh>
Classes | |
struct | Dir |
Public Types | |
using | Directories = std::vector< Dir > |
Public Member Functions | |
FilePoolCore (std::string fileCache, std::function< Directories()> getDirectories, std::function< void(std::string_view, float)> reportProgress) | |
~FilePoolCore () | |
File | getFile (FileType fileType, const Sha1Sum &sha1sum) |
Search file with the given sha1sum. | |
Sha1Sum | getSha1Sum (File &file) |
Calculate sha1sum for the given File object. | |
void | abort () |
This is only meaningful to call from within the 'reportProgress' callback (constructor parameter). | |
Friends | |
struct | GetSha1 |
Definition at line 37 of file FilePoolCore.hh.
using openmsx::FilePoolCore::Directories = std::vector<Dir> |
Definition at line 48 of file FilePoolCore.hh.
openmsx::FilePoolCore::FilePoolCore | ( | std::string | fileCache, |
std::function< Directories()> | getDirectories, | ||
std::function< void(std::string_view, float)> | reportProgress | ||
) |
Definition at line 27 of file FilePoolCore.cc.
openmsx::FilePoolCore::~FilePoolCore | ( | ) |
Definition at line 41 of file FilePoolCore.cc.
|
inline |
This is only meaningful to call from within the 'reportProgress' callback (constructor parameter).
This will abort the current search and cause getFile() to return a not-found result.
Definition at line 72 of file FilePoolCore.hh.
Search file with the given sha1sum.
If found it returns the (already opened) file, if not found it returns a close File object.
Definition at line 243 of file FilePoolCore.cc.
References openmsx::FileOperations::expandTilde(), openmsx::Timer::getTime(), openmsx::File::is_open(), openmsx::NONE, tmpStrCat(), and openmsx::Sha1Sum::toString().
Referenced by openmsx::FilePool::getFile(), and TEST_CASE().
Calculate sha1sum for the given File object.
If possible the result is retrieved from cache, avoiding the relatively expensive calculation.
Definition at line 460 of file FilePoolCore.cc.
References openmsx::File::getModificationDate(), openmsx::File::getURL(), and sum().
Referenced by openmsx::FilePool::getSha1Sum().
|
friend |
Definition at line 175 of file FilePoolCore.hh.