mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:12:45 +00:00 
			
		
		
		
	LibGUI: Add GFile and base class GIODevice.
Working with the LibC API's is tedious, so let's add some comfy C++ API's.
This commit is contained in:
		
							parent
							
								
									ef05d8cbf6
								
							
						
					
					
						commit
						ce7017e1ec
					
				
					 6 changed files with 230 additions and 9 deletions
				
			
		
							
								
								
									
										22
									
								
								LibGUI/GFile.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								LibGUI/GFile.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <LibGUI/GIODevice.h> | ||||
| #include <AK/AKString.h> | ||||
| 
 | ||||
| class GFile final : public GIODevice { | ||||
| public: | ||||
|     GFile() { } | ||||
|     explicit GFile(const String&); | ||||
|     virtual ~GFile() override; | ||||
| 
 | ||||
|     String filename() const { return m_filename; } | ||||
|     void set_filename(const String& filename) { m_filename = filename; } | ||||
| 
 | ||||
|     virtual bool open(GIODevice::OpenMode) override; | ||||
|     virtual bool close() override; | ||||
| 
 | ||||
|     virtual const char* class_name() const override { return "GFile"; } | ||||
| 
 | ||||
| private: | ||||
|     String m_filename; | ||||
| }; | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling