1 #ifndef SECTORACCESSIBLEDISK_HH
2 #define SECTORACCESSIBLEDISK_HH
37 [[nodiscard]] std::vector<Filename>
getPatches()
const;
47 SectorBuffer* buffers,
size_t startSector,
size_t nbSectors);
60 [[nodiscard]]
bool isPeekMode()
const {
return peekMode; }
67 virtual void writeSectorImpl(
size_t sector,
const SectorBuffer& buf) = 0;
68 [[nodiscard]]
virtual size_t getNbSectorsImpl()
const = 0;
69 [[nodiscard]]
virtual bool isWriteProtectedImpl()
const = 0;
72 std::unique_ptr<const PatchInterface> patch;
74 bool forcedWriteProtect =
false;
75 bool peekMode =
false;
This class represents a filename.
bool isWriteProtected() const
virtual bool isDummyDisk() const
virtual void checkCaches()
void readSector(size_t sector, SectorBuffer &buf)
void readSectors(SectorBuffer *buffers, size_t startSector, size_t nbSectors)
static constexpr size_t SECTOR_SIZE
size_t getNbSectors() const
Sha1Sum getSha1Sum(FilePool &filepool)
Calculate SHA1 of the content of this disk.
virtual void readSectorsImpl(SectorBuffer *buffers, size_t startSector, size_t nbSectors)
virtual void flushCaches()
virtual Sha1Sum getSha1SumImpl(FilePool &filepool)
void writeSectors(const SectorBuffer *buffers, size_t startSector, size_t nbSectors)
std::vector< Filename > getPatches() const
void applyPatch(Filename patchFile)
void writeSector(size_t sector, const SectorBuffer &buf)
virtual void readSectorImpl(size_t sector, SectorBuffer &buf)
void setPeekMode(bool peek)
This class represents the result of a sha1 calculation (a 160-bit value).
This file implemented 3 utility functions: