blob: 66a51a8f413d6fb2b153d89fbf0e614b708ec5c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#pragma once
#include <AK/Retainable.h>
#include <AK/Types.h>
// FIXME: Support 64-bit DiskOffset
typedef dword DiskOffset;
class DiskDevice : public Retainable<DiskDevice> {
public:
virtual ~DiskDevice();
virtual unsigned block_size() const = 0;
virtual bool read_block(unsigned index, byte*) const = 0;
virtual bool write_block(unsigned index, const byte*) = 0;
virtual const char* class_name() const = 0;
bool read(DiskOffset, unsigned length, byte*) const;
bool write(DiskOffset, unsigned length, const byte*);
virtual bool read_blocks(unsigned index, word count, byte*) = 0;
virtual bool write_blocks(unsigned index, word count, const byte*) = 0;
protected:
DiskDevice();
};
|