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

LibCore: Add standard_{output, input, error} functions to File::Stream

This commit is contained in:
davidot 2022-09-13 23:52:57 +02:00 committed by Andrew Kaster
parent e0cccaa583
commit d9360676cd
2 changed files with 18 additions and 2 deletions

View file

@ -198,6 +198,9 @@ public:
static ErrorOr<NonnullOwnPtr<File>> adopt_fd(int fd, OpenMode, ShouldCloseFileDescriptor = ShouldCloseFileDescriptor::Yes);
static bool exists(StringView filename);
static ErrorOr<NonnullOwnPtr<File>> standard_input();
static ErrorOr<NonnullOwnPtr<File>> standard_output();
static ErrorOr<NonnullOwnPtr<File>> standard_error();
static ErrorOr<NonnullOwnPtr<File>> open_file_or_standard_stream(StringView filename, OpenMode mode);
File(File&& other) { operator=(move(other)); }