22 #include "common/bitarray.h" 23 #include "common/ptr.h" 24 #include "common/file.h" 25 #include "common/debug.h" 27 #ifndef COMMON_FORMATS_DISK_IMAGE_H 28 #define COMMON_FORMATS_DISK_IMAGE_H 58 class SeekableReadStream;
65 DiskImageEncodingNone,
87 virtual const DataBlockPtr getDataBlock(
const Common::Path &filename, uint offset = 0)
const = 0;
89 virtual bool exists(
const Common::Path &filename)
const = 0;
100 return _files->createReadStream(_filename, _offset);
113 _inputStream(
nullptr),
114 _decodeStream(
nullptr),
115 _decodeBuffer(
nullptr),
116 _encoding(DiskImageEncodingNone),
117 _lazyDecoding(
false),
126 delete _decodeStream;
131 const DataBlockPtr getDataBlock(uint track, uint sector, uint offset = 0, uint size = 0)
const;
132 Common::SeekableReadStream *createReadStream(uint track, uint sector, uint offset = 0, uint size = 0, uint sectorsUsed = 0)
const;
135 uint32 read(
void *dataPtr, uint32 diskPosition, uint32 dataSize);
136 void setLazyDecoding(
bool lazyDecoding) { _lazyDecoding = lazyDecoding; }
137 void setSectorLimit(uint sectorLimit) { _sectorLimit = sectorLimit; }
138 uint getBytesPerSector()
const {
return _bytesPerSector; }
139 uint getSectorsPerTrack()
const {
return _sectorsPerTrack; }
140 uint getTracks()
const {
return _tracks; }
145 DataBlock(
const DiskImage *disk, uint track, uint sector, uint offset, uint size, uint sectorLimit) :
150 _sectorLimit(sectorLimit),
154 return _disk->createReadStream(_track, _sector, _offset, _size, _sectorLimit);
158 uint _track, _sector, _offset, _size;
171 uint _tracks, _sectorsPerTrack, _bytesPerSector, _firstSector;
176 void decodeTrack(uint track);
182 const DataBlockPtr getDataBlock(
const Common::Path &filename, uint offset = 0)
const override;
194 const DataBlockPtr getDataBlock(
const Common::Path &filename, uint offset = 0)
const override;
196 bool exists(
const Common::Path &filename)
const override {
return _toc.contains(filename); }
201 kFileTypeAppleSoft = 2,
Definition: disk_image.h:92
Definition: disk_image.h:188
Definition: disk_image.h:110
Definition: algorithm.h:29
Definition: bitarray.h:29
static bool exists(const Path &filename)
Definition: disk_image.h:143
Definition: disk_image.h:83
DiskImageEncoding
Definition: disk_image.h:64
Definition: disk_image.h:73
Definition: disk_image.h:180