mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 11:09:05 +03:00
LibCore: Add CIODevice::seek().
This commit is contained in:
parent
1debc0a78c
commit
b5759089d8
Notes:
sideshowbarker
2024-07-19 14:41:37 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b5759089d8a
@ -173,3 +173,14 @@ bool CIODevice::close()
|
||||
set_mode(CIODevice::NotOpen);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CIODevice::seek(signed_qword offset)
|
||||
{
|
||||
int rc = lseek(m_fd, offset, SEEK_SET);
|
||||
if (rc < 0) {
|
||||
perror("CIODevice::seek: lseek");
|
||||
return false;
|
||||
}
|
||||
m_buffered_data.clear();
|
||||
return true;
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ public:
|
||||
|
||||
bool can_read() const;
|
||||
|
||||
bool seek(signed_qword);
|
||||
|
||||
virtual bool open(CIODevice::OpenMode) = 0;
|
||||
virtual bool close();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user