diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/fud_c_file.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/fud_c_file.hpp b/include/fud_c_file.hpp index f451292..0d52e95 100644 --- a/include/fud_c_file.hpp +++ b/include/fud_c_file.hpp @@ -267,6 +267,17 @@ class CFile { return self.read(&destination, sizeof(destination), length, offset); } + [[nodiscard]] WriteResult write(const void* source, size_t sourceSize) + { + auto& self = static_cast<Derived&>(*this); + auto offsetResult = self.size(); + if (offsetResult.isError()) { + return WriteResult{0, offsetResult.getError()}; + } + + return self.write(source, sourceSize, sourceSize, offsetResult.getOkay()); + } + [[nodiscard]] WriteResult write(const void* source, size_t sourceSize, size_t length) { auto& self = static_cast<Derived&>(*this); |