mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:12:45 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			632 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			632 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 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(DiskOffset, unsigned length, byte*) const;
 | |
|     bool write(DiskOffset, unsigned length, const byte*);
 | |
| 
 | |
| protected:
 | |
|     DiskDevice();
 | |
| };
 | |
| 
 | 
