openMSX
|
#include <FilePool.hh>
Public Types | |
enum | FileType { SYSTEM_ROM = 1, ROM = 2, DISK = 4, TAPE = 8 } |
Public Member Functions | |
FilePool (CommandController &controller, Reactor &reactor) | |
~FilePool () | |
File | getFile (FileType fileType, const Sha1Sum &sha1sum) |
Search file with the given sha1sum. More... | |
Sha1Sum | getSha1Sum (File &file) |
Calculate sha1sum for the given File object. More... | |
Definition at line 24 of file FilePool.hh.
Enumerator | |
---|---|
SYSTEM_ROM | |
ROM | |
DISK | |
TAPE |
Definition at line 30 of file FilePool.hh.
openmsx::FilePool::FilePool | ( | CommandController & | controller, |
Reactor & | reactor | ||
) |
Definition at line 55 of file FilePool.cc.
References openmsx::Subject< T >::attach(), openmsx::Reactor::getEventDistributor(), openmsx::OPENMSX_QUIT_EVENT, and openmsx::EventDistributor::registerEventListener().
openmsx::FilePool::~FilePool | ( | ) |
Definition at line 76 of file FilePool.cc.
References openmsx::Subject< T >::detach(), openmsx::filename, openmsx::Reactor::getEventDistributor(), openmsx::OPENMSX_QUIT_EVENT, gl::rotate(), sum(), openmsx::EventDistributor::unregisterEventListener(), and ranges::upper_bound().
Search file with the given sha1sum.
If found it returns the (already opened) file, if not found it returns nullptr.
Definition at line 302 of file FilePool.cc.
References openmsx::SHA1::digest(), utf8::distance(), ranges::equal_range(), openmsx::FileOperations::expandTilde(), openmsx::Reactor::getCliComm(), openmsx::Reactor::getDisplay(), openmsx::ReadDir::getEntry(), openmsx::MSXException::getMessage(), openmsx::File::getModificationDate(), openmsx::FileOperations::getModificationDate(), openmsx::File::getOriginalName(), openmsx::FileOperations::getStat(), openmsx::Timer::getTime(), openmsx::File::is_open(), openmsx::FileOperations::isDirectory(), openmsx::FileOperations::isRegularFile(), openmsx::File::mmap(), openmsx::CliComm::printProgress(), openmsx::CliComm::printWarning(), openmsx::Display::repaint(), utf8::unchecked::size(), strCat(), openmsx::Sha1Sum::toString(), and openmsx::SHA1::update().
Referenced by openmsx::CassettePlayer::serialize(), and openmsx::DiskChanger::serialize().
Calculate sha1sum for the given File object.
If possible the result is retrieved from cache, avoiding the relatively expensive calculation.
Definition at line 545 of file FilePool.cc.
References openmsx::File::getModificationDate(), openmsx::File::getURL(), openmsx::OPENMSX_QUIT_EVENT, and sum().
Referenced by openmsx::DSKDiskImage::DSKDiskImage(), openmsx::Sha1SumCommand::execute(), openmsx::CasImage::getAmplificationFactorImpl(), openmsx::DMKDiskImage::getSha1SumImpl(), openmsx::HD::switchImage(), openmsx::WavImage::WavImage(), and openmsx::SCSILS120::~SCSILS120().