1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:47:35 +00:00

LibCore+Everywhere: Move OpenMode out of IODevice

...and make it an enum class so people don't omit "OpenMode".
This commit is contained in:
Ali Mohammad Pur 2021-05-12 13:56:43 +04:30 committed by Linus Groh
parent 422ef7904e
commit a91a49337c
113 changed files with 180 additions and 177 deletions

View file

@ -19,7 +19,7 @@ class File final : public IODevice {
public:
virtual ~File() override;
static Result<NonnullRefPtr<File>, String> open(String filename, IODevice::OpenMode, mode_t = 0644);
static Result<NonnullRefPtr<File>, String> open(String filename, OpenMode, mode_t = 0644);
String filename() const { return m_filename; }
void set_filename(const String filename) { m_filename = move(filename); }
@ -67,13 +67,13 @@ public:
};
static Result<void, RemoveError> remove(const String& path, RecursionMode, bool force);
virtual bool open(IODevice::OpenMode) override;
virtual bool open(OpenMode) override;
enum class ShouldCloseFileDescriptor {
No = 0,
Yes
};
bool open(int fd, IODevice::OpenMode, ShouldCloseFileDescriptor);
bool open(int fd, OpenMode, ShouldCloseFileDescriptor);
static NonnullRefPtr<File> standard_input();
static NonnullRefPtr<File> standard_output();
@ -86,7 +86,7 @@ private:
}
explicit File(String filename, Object* parent = nullptr);
bool open_impl(IODevice::OpenMode, mode_t);
bool open_impl(OpenMode, mode_t);
String m_filename;
ShouldCloseFileDescriptor m_should_close_file_descriptor { ShouldCloseFileDescriptor::Yes };