mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 18:45:06 +00:00

BlockDevice was the wrong name for this abstraction, since a block device is a type of file in a unix system, and we should use that name for that concept in the fs implementation.
20 lines
542 B
C++
20 lines
542 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;
|
|
virtual bool read(qword offset, unsigned length, byte*) const = 0;
|
|
virtual bool write(qword offset, unsigned length, const byte*) = 0;
|
|
|
|
protected:
|
|
DiskDevice();
|
|
};
|
|
|