|
@@ -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 };
|
|
|
};
|