1#ifndef SECTORACCESSIBLEDISK_HH
2#define SECTORACCESSIBLEDISK_HH
26 void readSectors (std::span< SectorBuffer> buffers,
size_t startSector)
const;
27 void writeSectors(std::span<const SectorBuffer> buffers,
size_t startSector);
38 [[nodiscard]] std::vector<Filename>
getPatches()
const;
48 std::span<SectorBuffer> buffers,
size_t startSector);
61 [[nodiscard]]
bool isPeekMode()
const {
return peekMode; }
68 virtual void writeSectorImpl(
size_t sector,
const SectorBuffer& buf) = 0;
69 [[nodiscard]]
virtual size_t getNbSectorsImpl()
const = 0;
70 [[nodiscard]]
virtual bool isWriteProtectedImpl()
const = 0;
73 std::unique_ptr<const PatchInterface> patch;
75 bool forcedWriteProtect =
false;
76 bool peekMode =
false;
This class represents a filename.
bool isWriteProtected() const
virtual bool isDummyDisk() const
void writeSectors(std::span< const SectorBuffer > buffers, size_t startSector)
void readSectors(std::span< SectorBuffer > buffers, size_t startSector) const
virtual Sha1Sum getSha1SumImpl(FilePool &filePool)
Sha1Sum getSha1Sum(FilePool &filePool)
Calculate SHA1 of the content of this disk.
virtual void checkCaches()
static constexpr size_t SECTOR_SIZE
size_t getNbSectors() const
virtual void flushCaches()
virtual void readSectorsImpl(std::span< SectorBuffer > buffers, size_t startSector)
std::vector< Filename > getPatches() const
void applyPatch(Filename patchFile)
void readSector(size_t sector, SectorBuffer &buf) const
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: