serenity/VirtualFileSystem/DiskDevice.h
2018-12-03 01:38:22 +01:00

27 lines
636 B
C++

#pragma once
#include <AK/Retainable.h>
#include <AK/Types.h>
#ifdef SERENITY
// FIXME: Support 64-bit DiskOffset
typedef dword DiskOffset;
#else
typedef qword DiskOffset;
#endif
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*);
protected:
DiskDevice();
};