1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:08:12 +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:
Andreas Kling 2019-03-17 15:54:43 +01:00
parent ef05d8cbf6
commit ce7017e1ec
6 changed files with 230 additions and 9 deletions

22
LibGUI/GFile.h Normal file
View 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;
};