mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:02:43 +00:00 
			
		
		
		
	 1f41a36c52
			
		
	
	
		1f41a36c52
		
	
	
	
	
		
			
			This allows me to keep prototyping things on a random desktop machine, even if that machine has its own ideas about foo_t types.
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			488 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			488 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include "VirtualFileSystem.h"
 | |
| #include <AK/ByteBuffer.h>
 | |
| 
 | |
| class FileHandle {
 | |
| public:
 | |
|     explicit FileHandle(RetainPtr<VirtualFileSystem::Node>&&);
 | |
|     ~FileHandle();
 | |
| 
 | |
|     Unix::off_t seek(Unix::off_t, int whence);
 | |
|     Unix::ssize_t read(byte* buffer, Unix::size_t count);
 | |
|     int stat(Unix::stat*);
 | |
| 
 | |
|     ByteBuffer readEntireFile();
 | |
| 
 | |
| private:
 | |
|     friend class VirtualFileSystem;
 | |
| 
 | |
|     RetainPtr<VirtualFileSystem::Node> m_vnode;
 | |
| 
 | |
|     Unix::off_t m_currentOffset { 0 };
 | |
| };
 | |
| 
 |