mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
This way subclasses only have to implement readBlock() and writeBlock(). read() and write() require that the offset and length are both divisible by the blockSize().
21 lines
518 B
C++
21 lines
518 B
C++
#pragma once
|
|
|
|
#include <AK/Retainable.h>
|
|
#include <AK/Types.h>
|
|
|
|
class DiskDevice : public Retainable<DiskDevice> {
|
|
public:
|
|
virtual ~DiskDevice();
|
|
|
|
virtual unsigned blockSize() const = 0;
|
|
virtual bool readBlock(unsigned index, byte*) const = 0;
|
|
virtual bool writeBlock(unsigned index, const byte*) = 0;
|
|
virtual const char* className() const = 0;
|
|
bool read(qword offset, unsigned length, byte*) const;
|
|
bool write(qword offset, unsigned length, const byte*);
|
|
|
|
protected:
|
|
DiskDevice();
|
|
};
|
|
|