ladybird/Kernel/DiskDevice.h

24 lines
581 B
C
Raw Normal View History

#pragma once
#include <AK/Retainable.h>
#include <AK/Types.h>
2018-10-17 10:55:43 +02:00
// FIXME: Support 64-bit DiskOffset
typedef dword DiskOffset;
class DiskDevice : public Retainable<DiskDevice> {
public:
virtual ~DiskDevice();
2018-12-03 01:38:22 +01:00
virtual unsigned block_size() const = 0;
virtual bool read_block(unsigned index, byte*) const = 0;
virtual bool write_block(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();
};