|
openMSX
|
#include <FilePool.hh>


Classes | |
| struct | Entry |
Public Types | |
| enum | FileType { SYSTEM_ROM = 1, ROM = 2, DISK = 4, TAPE = 8 } |
Public Member Functions | |
| FilePool (CommandController &controler, EventDistributor &distributor) | |
| ~FilePool () | |
| std::unique_ptr< 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 | removeSha1Sum (File &file) |
| Remove sha1sum for this file from the cache. | |
Additional Inherited Members | |
Private Member Functions inherited from openmsx::Observer< Setting > | |
| virtual void | update (const Setting &subject)=0 |
| virtual void | subjectDeleted (const Setting &) |
| virtual | ~Observer () |
Private Member Functions inherited from openmsx::EventListener | |
| virtual | ~EventListener () |
| virtual int | signalEvent (const std::shared_ptr< const Event > &event)=0 |
| This method gets called when an event you are subscribed to occurs. | |
| EventListener () | |
Definition at line 25 of file FilePool.hh.
Definition at line 32 of file FilePool.hh.
| openmsx::FilePool::FilePool | ( | CommandController & | controler, |
| EventDistributor & | distributor | ||
| ) |
Definition at line 56 of file FilePool.cc.
References openmsx::OPENMSX_QUIT_EVENT, and openmsx::EventDistributor::registerEventListener().
| openmsx::FilePool::~FilePool | ( | ) |
Definition at line 72 of file FilePool.cc.
References openmsx::OPENMSX_QUIT_EVENT, and openmsx::EventDistributor::unregisterEventListener().
Search file with the given sha1sum.
If found it returns the (already opened) file, if not found it returns nullptr.
Definition at line 213 of file FilePool.cc.
References openmsx::FileOperations::expandTilde(), openmsx::MSXException::getMessage(), openmsx::Timer::getTime(), and openmsx::CliComm::printWarning().
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 388 of file FilePool.cc.
References openmsx::File::getModificationDate(), and openmsx::File::getURL().
Referenced by openmsx::File::getSha1Sum().
| void openmsx::FilePool::removeSha1Sum | ( | File & | file | ) |
Remove sha1sum for this file from the cache.
When the file was written to, sha1sum changes and it should be removed from the cache.
Definition at line 410 of file FilePool.cc.
References openmsx::File::getURL().
Referenced by openmsx::File::write().
1.8.1.2