|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Unique handle to a writable file in the native Filesystem. More...
#include <GREM/core/system/NativeOutputFile.hpp>

Public Member Functions | |
| NativeOutputFile () noexcept=default | |
| Construct a closed file handle without an associated file. | |
| ~NativeOutputFile () override=default | |
| Destructor. | |
| NativeOutputFile (const NativeOutputFile &)=delete | |
| Copying a file handle is not allowed. | |
| NativeOutputFile (NativeOutputFile &&other) | |
| Move constructor. | |
| NativeOutputFile & | operator= (const NativeOutputFile &)=delete |
| Copying a file handle is not allowed. | |
| NativeOutputFile & | operator= (NativeOutputFile &&)=default |
| Move assignment. | |
| void | close () override |
| Close the associated file so that it can no longer be accessed through this handle, and reset the handle to a closed file handle without an associated file. | |
| bool | isOpen () const noexcept override |
| Check if the file handle has an open file associated with it. | |
| size_t | tellp () const noexcept override |
| Get the current writing position of the file. | |
| void | seekp (size_t position) override |
| Set the file writing position to an absolute offset from the beginning of the file. | |
| void | skipp (ptrdiff_t offset) override |
| Advance the file writing position by a relative offset, which may be negative in order to go backwards. | |
| size_t | writeSome (Span< const byte > data) override |
| Write data to the end of an open file from a buffer. | |
| void | flush () override |
| Synchronize with the underlying file to make sure that all buffered data that has been written so far is flushed into the actual file. | |
| Public Member Functions inherited from grem::OutputFile | |
| OutputFile () noexcept=default | |
| Default constructor. | |
| GREM_ALWAYS_INLINE | operator Writer () & |
| Get a writer for the file. | |
| void | write (Span< const byte > data) |
| Write data to the end of an open file. | |
| void | write (StringView string) |
| Write data from a string to the end of an open file. | |
| Public Member Functions inherited from grem::File | |
| File () noexcept=default | |
| Default constructor. | |
| virtual | ~File ()=default |
| Virtual destructor. | |
| File (const File &)=default | |
| Copy constructor. | |
| File (File &&) noexcept=default | |
| Move constructor. | |
| File & | operator= (const File &)=default |
| Copy assignment. | |
| File & | operator= (File &&) noexcept=default |
| Move assignment. | |
| operator bool () const noexcept | |
| Check if the file handle has an open file associated with it. | |
Additional Inherited Members | |
| Public Types inherited from grem::File | |
| enum class | Kind : uint8_t { REGULAR , DIRECTORY , SYMLINK , OTHER } |
| File entry type. More... | |
| Static Public Attributes inherited from grem::File | |
| static constexpr size_t | npos = static_cast<size_t>(-1) |
| Invalid value for a file offset, used as an end-of-file marker. | |
Unique handle to a writable file in the native Filesystem.
|
defaultnoexcept |
Construct a closed file handle without an associated file.
|
overridedefault |
Destructor.
|
delete |
Copying a file handle is not allowed.
|
inline |
Move constructor.
|
delete |
Copying a file handle is not allowed.
|
default |
Move assignment.
|
inlineoverridevirtual |
Close the associated file so that it can no longer be accessed through this handle, and reset the handle to a closed file handle without an associated file.
| File::Error | on failure to close the file. |
| std::bad_alloc | on allocation failure. |
Implements grem::File.
|
inlinenodiscardoverridevirtualnoexcept |
Check if the file handle has an open file associated with it.
Implements grem::File.
|
inlinenodiscardoverridevirtualnoexcept |
Get the current writing position of the file.
Implements grem::OutputFile.
|
inlineoverridevirtual |
Set the file writing position to an absolute offset from the beginning of the file.
| position | the new writing position to set. |
| File::Error | on failure to seek to the given position. |
Implements grem::OutputFile.
|
inlineoverridevirtual |
Advance the file writing position by a relative offset, which may be negative in order to go backwards.
| offset | the relative offset to advance the writing position by. |
| File::Error | on failure to skip by the given offset. |
Implements grem::OutputFile.
|
inlineoverridevirtual |
Write data to the end of an open file from a buffer.
The writing position is advanced to the new end of the file.
| data | read-only view over the buffer to copy the data from. The size of the buffer determines the number of bytes that are attempted to be written. |
| File::Error | on failure to write to the file. |
Implements grem::OutputFile.
|
inlineoverridevirtual |
Synchronize with the underlying file to make sure that all buffered data that has been written so far is flushed into the actual file.
| File::Error | on failure to synchronize with the file. |
Implements grem::OutputFile.