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

LibCore: Use ErrorOr<T> for Core::File::open()

This commit is contained in:
Andreas Kling 2021-11-07 02:15:10 +01:00
parent fac2550143
commit a7f1f1c34b
24 changed files with 42 additions and 48 deletions

View file

@ -7,8 +7,6 @@
#pragma once
#include <AK/Error.h>
#include <AK/OSError.h>
#include <AK/Result.h>
#include <AK/String.h>
#include <LibCore/IODevice.h>
#include <sys/stat.h>
@ -20,7 +18,7 @@ class File final : public IODevice {
public:
virtual ~File() override;
static Result<NonnullRefPtr<File>, OSError> open(String filename, OpenMode, mode_t = 0644);
static ErrorOr<NonnullRefPtr<File>> open(String filename, OpenMode, mode_t = 0644);
String filename() const { return m_filename; }
void set_filename(const String filename) { m_filename = move(filename); }