From 0f3d191a7003183033e663bb975c0909d26c7b8c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 30 Jul 2019 15:16:14 +0200 Subject: [PATCH] LibCore: Rename CFileStreamReader => CIODeviceStreamReader. --- Libraries/LibAudio/AWavLoader.cpp | 4 ++-- ...CFileStreamReader.h => CIODeviceStreamReader.h} | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) rename Libraries/LibCore/{CFileStreamReader.h => CIODeviceStreamReader.h} (57%) diff --git a/Libraries/LibAudio/AWavLoader.cpp b/Libraries/LibAudio/AWavLoader.cpp index 46371d88415..f1a1fe55538 100644 --- a/Libraries/LibAudio/AWavLoader.cpp +++ b/Libraries/LibAudio/AWavLoader.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include AWavLoader::AWavLoader(const StringView& path) @@ -33,7 +33,7 @@ RefPtr AWavLoader::get_more_samples() bool AWavLoader::parse_header() { - CFileStreamReader stream(m_file); + CIODeviceStreamReader stream(m_file); #define CHECK_OK(msg) \ do { \ diff --git a/Libraries/LibCore/CFileStreamReader.h b/Libraries/LibCore/CIODeviceStreamReader.h similarity index 57% rename from Libraries/LibCore/CFileStreamReader.h rename to Libraries/LibCore/CIODeviceStreamReader.h index 1f6d6438aa1..60d26c3fcf5 100644 --- a/Libraries/LibCore/CFileStreamReader.h +++ b/Libraries/LibCore/CIODeviceStreamReader.h @@ -1,12 +1,12 @@ #pragma once #include -#include +#include -class CFileStreamReader { +class CIODeviceStreamReader { public: - CFileStreamReader(CFile& file) - : m_file(file) + CIODeviceStreamReader(CIODevice& device) + : m_device(device) { } @@ -16,9 +16,9 @@ public: } template - 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 }; };