LibCore: Rename CFileStreamReader => CIODeviceStreamReader.

This commit is contained in:
Andreas Kling 2019-07-30 15:16:14 +02:00
parent c869d62e16
commit 0f3d191a70
Notes: sideshowbarker 2024-07-19 12:59:21 +09:00
2 changed files with 9 additions and 9 deletions

View file

@ -2,7 +2,7 @@
#include <LibAudio/ABuffer.h>
#include <LibAudio/AWavLoader.h>
#include <LibCore/CFile.h>
#include <LibCore/CFileStreamReader.h>
#include <LibCore/CIODeviceStreamReader.h>
#include <limits>
AWavLoader::AWavLoader(const StringView& path)
@ -33,7 +33,7 @@ RefPtr<ABuffer> AWavLoader::get_more_samples()
bool AWavLoader::parse_header()
{
CFileStreamReader stream(m_file);
CIODeviceStreamReader stream(m_file);
#define CHECK_OK(msg) \
do { \

View file

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