diff options
| author | JosJuice <josjuice@gmail.com> | 2022-01-29 11:59:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-29 11:59:58 +0100 |
| commit | af5678ea758d493c419ca53c56a0ce4f8fa0ca0f (patch) | |
| tree | 6e76a1fee0e79d593d95c9680d2353f9033b0ac6 /Source/Core/Common/IOFile.h | |
| parent | fbe7cf675cf412af12d2f750c6162f6e4151c52c (diff) | |
| parent | a336c4386c154746ef2ea732b13872f5293666be (diff) | |
Merge pull request #10403 from AdmiralCurtiss/iofile-seek
Minor IOFile cleanup.
Diffstat (limited to 'Source/Core/Common/IOFile.h')
| -rw-r--r-- | Source/Core/Common/IOFile.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/Common/IOFile.h b/Source/Core/Common/IOFile.h index 873c4c2af5..0c14fad838 100644 --- a/Source/Core/Common/IOFile.h +++ b/Source/Core/Common/IOFile.h @@ -13,6 +13,13 @@ namespace File { +enum class SeekOrigin +{ + Begin, + Current, + End, +}; + // simple wrapper for cstdlib file functions to // hopefully will make error checking easier // and make forgetting an fclose() harder @@ -89,14 +96,14 @@ public: std::FILE* GetHandle() { return m_file; } void SetHandle(std::FILE* file); - bool Seek(s64 off, int origin); + bool Seek(s64 offset, SeekOrigin origin); u64 Tell() const; u64 GetSize() const; bool Resize(u64 size); bool Flush(); // clear error state - void Clear() + void ClearError() { m_good = true; std::clearerr(m_file); |
