2#include "..\..\Common\Platform.hpp"
3#include "OutputStream.hpp"
4#ifdef MCE_PLATFORM_WINDOWS
5#undef INVALID_FILE_SIZE
30 bool open(
const std::string& file);
49 size_t write(
const void* buffer,
size_t size)
override;
56 size_t seek(
size_t position)
override;
84#ifdef MCE_PLATFORM_WINDOWS
91 void* hFile =
nullptr;
92#elif defined(MCE_PLATFORM_LINUX) || defined(MCE_PLATFORM_MACOS)
96 std::FILE* file =
nullptr;
FileOutputStream()=default
Default constructor.
static constexpr size_t INVALID_FILE_SIZE
Constant indicating an invalid file size/position.
Definition FileOutputStream.hpp:76
size_t getSize() override
Get the total size of the underlying file in bytes.
void close()
Close the file and release any resources.
static constexpr size_t INVALID_FILE_POSITION
Constant indicating an invalid file position.
Definition FileOutputStream.hpp:81
size_t seek(size_t position) override
Change the current write position in the file.
size_t tell() override
Get the current write position in the file.
size_t write(const void *buffer, size_t size) override
Write bytes to the file.
bool open(const std::string &file)
Opens a file for writing (creates/truncates by default).
bool isOpen() const
Query whether the underlying file handle is open.
Definition OutputStream.hpp:6