mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-29 22:42:52 +00:00
LibCore: Add CFileStreamReader, a simple streaming CFile reader.
This is extremely barebones right now, but can be used to easily read binary data from a CFile piece by piece.
This commit is contained in:
parent
be1025c03f
commit
a292d8cd5a
Notes:
sideshowbarker
2024-07-19 13:01:41 +09:00
Author: https://github.com/awesomekling
Commit: a292d8cd5a
3 changed files with 41 additions and 0 deletions
|
@ -22,6 +22,13 @@ const char* CIODevice::error_string() const
|
|||
return strerror(m_error);
|
||||
}
|
||||
|
||||
int CIODevice::read(u8* buffer, int length)
|
||||
{
|
||||
auto read_buffer = read(length);
|
||||
memcpy(buffer, read_buffer.data(), length);
|
||||
return read_buffer.size();
|
||||
}
|
||||
|
||||
ByteBuffer CIODevice::read(int max_size)
|
||||
{
|
||||
if (m_fd < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue