ladybird/VirtualFileSystem/DiskDevice.h

28 lines
633 B
C
Raw Normal View History

#pragma once
#include <AK/Retainable.h>
#include <AK/Types.h>
2018-10-22 14:06:22 +02:00
#ifdef SERENITY
2018-10-17 10:55:43 +02:00
// FIXME: Support 64-bit DiskOffset
typedef dword DiskOffset;
#else
typedef qword DiskOffset;
#endif
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;
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*);
protected:
DiskDevice();
};