diff options
| author | bunnei <bunneidev@gmail.com> | 2016-03-20 16:11:49 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2016-03-20 16:11:49 -0400 |
| commit | b83e95727f95fa6fe35d436be3e821605244a6a8 (patch) | |
| tree | 64255c7432e882205a2dbea1fe962025863664ee /src/core/file_sys/file_backend.h | |
| parent | ff6c24932a1d748f083adae66c58bf7ebc760535 (diff) | |
| parent | f707026ac50c53716ac697ed439630d7728e9db6 (diff) | |
Merge pull request #1302 from Subv/save_fix
HLE/FS: Fixed many corner cases in our file handling
Diffstat (limited to 'src/core/file_sys/file_backend.h')
| -rw-r--r-- | src/core/file_sys/file_backend.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/file_sys/file_backend.h b/src/core/file_sys/file_backend.h index df7165df3..9137bbbad 100644 --- a/src/core/file_sys/file_backend.h +++ b/src/core/file_sys/file_backend.h @@ -7,6 +7,7 @@ #include <cstddef> #include "common/common_types.h" +#include "core/hle/result.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace @@ -20,18 +21,18 @@ public: /** * Open the file - * @return true if the file opened correctly + * @return Result of the file operation */ - virtual bool Open() = 0; + virtual ResultCode Open() = 0; /** * Read data from the file * @param offset Offset in bytes to start reading data from * @param length Length in bytes of data to read from file * @param buffer Buffer to read data into - * @return Number of bytes read + * @return Number of bytes read, or error code */ - virtual size_t Read(u64 offset, size_t length, u8* buffer) const = 0; + virtual ResultVal<size_t> Read(u64 offset, size_t length, u8* buffer) const = 0; /** * Write data to the file @@ -39,9 +40,9 @@ public: * @param length Length in bytes of data to write to file * @param flush The flush parameters (0 == do not flush) * @param buffer Buffer to read data from - * @return Number of bytes written + * @return Number of bytes written, or error code */ - virtual size_t Write(u64 offset, size_t length, bool flush, const u8* buffer) const = 0; + virtual ResultVal<size_t> Write(u64 offset, size_t length, bool flush, const u8* buffer) const = 0; /** * Get the size of the file in bytes |
