mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibCore: Rename CFileStreamReader => CIODeviceStreamReader.
This commit is contained in:
parent
c869d62e16
commit
0f3d191a70
2 changed files with 9 additions and 9 deletions
|
@ -1,12 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <LibCore/CFile.h>
|
||||
#include <LibCore/CIODevice.h>
|
||||
|
||||
class CFileStreamReader {
|
||||
class CIODeviceStreamReader {
|
||||
public:
|
||||
CFileStreamReader(CFile& file)
|
||||
: m_file(file)
|
||||
CIODeviceStreamReader(CIODevice& device)
|
||||
: m_device(device)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,9 @@ public:
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
CFileStreamReader& operator>>(T& value)
|
||||
CIODeviceStreamReader& operator>>(T& value)
|
||||
{
|
||||
int nread = m_file.read((u8*)&value, sizeof(T));
|
||||
int nread = m_device.read((u8*)&value, sizeof(T));
|
||||
ASSERT(nread == sizeof(T));
|
||||
if (nread != sizeof(T))
|
||||
m_had_failure = true;
|
||||
|
@ -26,6 +26,6 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
CFile& m_file;
|
||||
CIODevice& m_device;
|
||||
bool m_had_failure { false };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue