mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-02 16:32:55 +00:00
IOFile: Make origin parameter to Seek() an enum class.
This commit is contained in:
parent
c2d8191fbb
commit
36cfcb530f
26 changed files with 116 additions and 78 deletions
|
@ -106,9 +106,25 @@ u64 IOFile::GetSize() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool IOFile::Seek(s64 off, int origin)
|
||||
bool IOFile::Seek(s64 offset, SeekOrigin origin)
|
||||
{
|
||||
if (!IsOpen() || 0 != fseeko(m_file, off, origin))
|
||||
int fseek_origin;
|
||||
switch (origin)
|
||||
{
|
||||
case SeekOrigin::Begin:
|
||||
fseek_origin = SEEK_SET;
|
||||
break;
|
||||
case SeekOrigin::Current:
|
||||
fseek_origin = SEEK_CUR;
|
||||
break;
|
||||
case SeekOrigin::End:
|
||||
fseek_origin = SEEK_END;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!IsOpen() || 0 != fseeko(m_file, offset, fseek_origin))
|
||||
m_good = false;
|
||||
|
||||
return m_good;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue