openMSX
|
#include <FilePool.hh>
Public Member Functions | |
FilePool (CommandController &controller, Reactor &reactor) | |
~FilePool () | |
File | getFile (FileType fileType, const Sha1Sum &sha1sum) |
Search file with the given sha1sum. | |
Sha1Sum | getSha1Sum (File &file) |
Calculate sha1sum for the given File object. | |
std::optional< Sha1Sum > | getSha1Sum (const std::string &filename) |
FilePoolCore::Directories | getDirectories () const |
Definition at line 19 of file FilePool.hh.
openmsx::FilePool::FilePool | ( | CommandController & | controller, |
Reactor & | reactor | ||
) |
Definition at line 31 of file FilePool.cc.
References getDirectories().
openmsx::FilePool::~FilePool | ( | ) |
Definition at line 47 of file FilePool.cc.
References openmsx::Subject< T >::detach(), openmsx::Reactor::getEventDistributor(), openmsx::QUIT, and openmsx::EventDistributor::unregisterEventListener().
FilePoolCore::Directories openmsx::FilePool::getDirectories | ( | ) | const |
Definition at line 94 of file FilePool.cc.
References openmsx::Reactor::getCliComm(), openmsx::Setting::getInterpreter(), openmsx::TclObject::getListIndex(), openmsx::TclObject::getListLength(), openmsx::TclObject::getString(), openmsx::Setting::getValue(), openmsx::NONE, openmsx::FilePoolCore::Dir::path, openmsx::CliComm::printWarning(), openmsx::FilePoolCore::Dir::types, and xrange().
Referenced by FilePool().
Search file with the given sha1sum.
If found it returns the (already opened) file, if not found it returns nullptr.
Definition at line 53 of file FilePool.cc.
References openmsx::FilePoolCore::getFile().
Referenced by openmsx::CassettePlayer::serialize(), and openmsx::DiskChanger::serialize().
std::optional< Sha1Sum > openmsx::FilePool::getSha1Sum | ( | const std::string & | filename | ) |
Definition at line 63 of file FilePool.cc.
References getSha1Sum().
Calculate sha1sum for the given File object.
If possible the result is retrieved from cache, avoiding the relatively expensive calculation.
Definition at line 58 of file FilePool.cc.
References openmsx::FilePoolCore::getSha1Sum().
Referenced by openmsx::WavImageCache::get(), getSha1Sum(), openmsx::DMKDiskImage::getSha1SumImpl(), and openmsx::ImGuiManager::paintImGui().