Classes | Public Types | Public Member Functions | List of all members
openmsx::FilePool Class Referencefinal

#include <FilePool.hh>

Inheritance diagram for openmsx::FilePool:
Inheritance graph
Collaboration diagram for openmsx::FilePool:
Collaboration graph

Public Types

enum  FileType { SYSTEM_ROM = 1, ROM = 2, DISK = 4, TAPE = 8 }

Public Member Functions

 FilePool (CommandController &controler, EventDistributor &distributor)
 ~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...

Detailed Description

Definition at line 23 of file FilePool.hh.

Member Enumeration Documentation


Definition at line 29 of file FilePool.hh.

Constructor & Destructor Documentation

openmsx::FilePool::FilePool ( CommandController controler,
EventDistributor distributor 
openmsx::FilePool::~FilePool ( )

Member Function Documentation

File openmsx::FilePool::getFile ( FileType  fileType,
const Sha1Sum sha1sum 

Search file with the given sha1sum.

If found it returns the (already opened) file, if not found it returns nullptr.

Definition at line 252 of file

References openmsx::FileOperations::expandTilde(), openmsx::MSXException::getMessage(), openmsx::Timer::getTime(), openmsx::File::is_open(), and openmsx::CliComm::printWarning().

Referenced by openmsx::CassettePlayer::serialize(), and openmsx::DiskChanger::serialize().

Sha1Sum openmsx::FilePool::getSha1Sum ( File file)

Calculate sha1sum for the given File object.

If possible the result is retrieved from cache, avoiding the relatively expensive calculation.

Definition at line 479 of file

References end(), openmsx::File::getModificationDate(), openmsx::File::getURL(), and gl::sum().

Referenced by openmsx::DMKDiskImage::getSha1SumImpl(), and openmsx::WavImage::WavImage().

The documentation for this class was generated from the following files: