2018-10-10 11:53:07 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Retainable.h>
|
|
|
|
|
#include <AK/Types.h>
|
|
|
|
|
|
2018-10-17 10:55:43 +02:00
|
|
|
// FIXME: Support 64-bit DiskOffset
|
|
|
|
|
typedef dword DiskOffset;
|
|
|
|
|
|
2018-10-16 11:21:49 +02:00
|
|
|
class DiskDevice : public Retainable<DiskDevice> {
|
2018-10-10 11:53:07 +02:00
|
|
|
public:
|
2018-10-16 11:21:49 +02:00
|
|
|
virtual ~DiskDevice();
|
2018-10-10 11:53:07 +02:00
|
|
|
|
2018-12-03 01:38:22 +01:00
|
|
|
virtual unsigned block_size() const = 0;
|
|
|
|
|
virtual bool read_block(unsigned index, byte*) const = 0;
|
|
|
|
|
virtual bool write_block(unsigned index, const byte*) = 0;
|
2018-11-15 15:36:35 +01:00
|
|
|
virtual const char* class_name() const = 0;
|
2018-10-17 10:55:43 +02:00
|
|
|
bool read(DiskOffset, unsigned length, byte*) const;
|
|
|
|
|
bool write(DiskOffset, unsigned length, const byte*);
|
2018-10-10 11:53:07 +02:00
|
|
|
|
|
|
|
|
protected:
|
2018-10-16 11:21:49 +02:00
|
|
|
DiskDevice();
|
2018-10-10 11:53:07 +02:00
|
|
|
};
|
|
|
|
|
|