4#ifndef GREM_APPLICATION_VIRTUAL_OUTPUT_FILE_HPP
5#define GREM_APPLICATION_VIRTUAL_OUTPUT_FILE_HPP
19#ifdef GREM_USE_MULTITHREADING
44 [[nodiscard]]
bool isOpen() const noexcept
override {
45 return static_cast<bool>(file);
57 friend VirtualFilesystem;
59#ifdef GREM_USE_MULTITHREADING
69 GREM_API(
application)
void operator()(
void* handle)
const noexcept;
72 UniqueHandle<void*, FileDeleter> file{};
73#ifdef GREM_USE_MULTITHREADING
74 VirtualFilesystem::FileLock
lock{};
OutputFile() noexcept=default
Default constructor.
void skipp(ptrdiff_t offset) override
Advance the file writing position by a relative offset, which may be negative in order to go backward...
bool isOpen() const noexcept override
Check if the file handle has an open file associated with it.
Definition VirtualOutputFile.hpp:44
void seekp(size_t position) override
Set the file writing position to an absolute offset from the beginning of the file.
void flush() override
Synchronize with the underlying file to make sure that all buffered data that has been written so far...
VirtualOutputFile() noexcept=default
Construct a closed file handle without an associated file.
void close() override
Close the associated file so that it can no longer be accessed through this handle,...
size_t writeSome(Span< const byte > data) override
Write data to the end of an open file from a buffer.
size_t tellp() const noexcept override
Get the current writing position of the file.
Definition Application.hpp:18
GREM_ALWAYS_INLINE void lock(Lockable1 &lock1, Lockable2 &lock2, LockableN &... lockN)
Definition synchronization.hpp:1268