Classes | Public Types | Public Member Functions | Friends | List of all members
openmsx::FilePoolCore Class Reference

#include <FilePoolCore.hh>


struct  Dir

Public Types

using Directories = std::vector< Dir >

Public Member Functions

 FilePoolCore (std::string filecache, std::function< Directories()> getDirectories, std::function< void(const std::string &)> reportProgress)
 ~FilePoolCore ()
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...
void abort ()
 This is only meaningful to call from within the 'reportProgress' callback (constructor parameter). More...


class CompareSha1

Detailed Description

Definition at line 37 of file FilePoolCore.hh.

Member Typedef Documentation

◆ Directories

Definition at line 44 of file FilePoolCore.hh.

Constructor & Destructor Documentation

◆ FilePoolCore()

openmsx::FilePoolCore::FilePoolCore ( std::string  filecache,
std::function< Directories()>  getDirectories,
std::function< void(const std::string &)>  reportProgress 

Definition at line 31 of file

◆ ~FilePoolCore()

openmsx::FilePoolCore::~FilePoolCore ( )

Definition at line 45 of file

Member Function Documentation

◆ abort()

void openmsx::FilePoolCore::abort ( )

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 68 of file FilePoolCore.hh.

◆ getFile()

File openmsx::FilePoolCore::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 a close File object.

Definition at line 247 of file

References openmsx::FileOperations::expandTilde(), openmsx::Timer::getTime(), openmsx::File::is_open(), and openmsx::NONE.

Referenced by openmsx::FilePool::getFile().

◆ getSha1Sum()

Sha1Sum openmsx::FilePoolCore::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 454 of file

Referenced by openmsx::FilePool::getSha1Sum().

Friends And Related Function Documentation

◆ CompareSha1

friend class CompareSha1

Definition at line 167 of file FilePoolCore.hh.

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