4#include "../Strings/StringView.h"
5#include "FileDescriptor.h"
An heap allocated byte buffer that can optionally use an inline buffer.
Definition: Buffer.h:25
Additional flags to be set when opening files.
Definition: File.h:35
bool blocking
Set to false if file will be used for Async I/O (see Async)
Definition: File.h:37
bool inheritable
Set to true to make the file visible to child processes.
Definition: File.h:36
File Descriptor (use SC::File to open and use it with strings and buffers).
Definition: FileDescriptor.h:52
Wraps a SC::FileDescriptor to open it and use strings / buffers.
Definition: File.h:19
Result readUntilEOF(String &destination)
Reads into a given string until End of File (EOF) is signaled It works also for non-seekable file des...
Result open(StringView path, OpenMode mode, OpenOptions options)
Opens file at path with a given mode
OpenMode
Define mode for opening the file (read, write etc.)
Definition: File.h:26
@ ReadAndWrite
Opens file for read / write mode.
Definition: File.h:30
@ WriteAppend
Opens write mode, appending to existing file that must exist at the same location.
Definition: File.h:29
@ WriteCreateTruncate
Opens in write mode, creating or truncating it if another file exists at same location.
Definition: File.h:28
@ ReadOnly
Opens in read-only mode.
Definition: File.h:27
Result open(StringView path, OpenMode mode)
Opens file at path with a given mode
Result readUntilEOF(Buffer &destination)
Reads into a given dynamic buffer until End of File (EOF) is signaled.
An ascii string used as boolean result. SC_TRY macro forwards errors to caller.
Definition: Result.h:12
A non-modifiable owning string with associated encoding.
Definition: String.h:29
Non-owning view over a range of characters with UTF Encoding.
Definition: StringView.h:47