10 #include <ToolchefsSTL/Globals.h>
11 #include <ToolchefsSTL/String.h>
14 namespace ToolchefsSTL
20 enum class Mode: uint8_t
27 enum class SeekPosition : uint8_t
36 FileStream(
const String& filePath, Mode mode = Mode::read,
bool update =
false,
bool asBinary =
true) noexcept;
44 bool open(
const String& filePath, Mode mode = Mode::read,
bool update =
false,
bool asBinary =
true);
46 bool openTempFile() noexcept;
48 void close() noexcept;
50 bool isOpen()
const noexcept;
52 void seek(int64_t offset, SeekPosition pos = SeekPosition::Current) noexcept;
54 int64_t tell()
const noexcept;
56 size_t read(
void* ptr,
size_t size,
size_t count)
const noexcept;
58 size_t write(
const void* ptr,
size_t size,
size_t count) noexcept;
60 fpos_t getPos()
const noexcept;
62 void setPos(
const fpos_t& pos) noexcept;
64 size_t size() noexcept;