mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibCore: Rename CFileStreamReader => CIODeviceStreamReader.
This commit is contained in:
parent
c869d62e16
commit
0f3d191a70
Notes:
sideshowbarker
2024-07-19 12:59:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0f3d191a700
2 changed files with 9 additions and 9 deletions
|
@ -2,7 +2,7 @@
|
||||||
#include <LibAudio/ABuffer.h>
|
#include <LibAudio/ABuffer.h>
|
||||||
#include <LibAudio/AWavLoader.h>
|
#include <LibAudio/AWavLoader.h>
|
||||||
#include <LibCore/CFile.h>
|
#include <LibCore/CFile.h>
|
||||||
#include <LibCore/CFileStreamReader.h>
|
#include <LibCore/CIODeviceStreamReader.h>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
AWavLoader::AWavLoader(const StringView& path)
|
AWavLoader::AWavLoader(const StringView& path)
|
||||||
|
@ -33,7 +33,7 @@ RefPtr<ABuffer> AWavLoader::get_more_samples()
|
||||||
|
|
||||||
bool AWavLoader::parse_header()
|
bool AWavLoader::parse_header()
|
||||||
{
|
{
|
||||||
CFileStreamReader stream(m_file);
|
CIODeviceStreamReader stream(m_file);
|
||||||
|
|
||||||
#define CHECK_OK(msg) \
|
#define CHECK_OK(msg) \
|
||||||
do { \
|
do { \
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/StdLibExtras.h>
|
#include <AK/StdLibExtras.h>
|
||||||
#include <LibCore/CFile.h>
|
#include <LibCore/CIODevice.h>
|
||||||
|
|
||||||
class CFileStreamReader {
|
class CIODeviceStreamReader {
|
||||||
public:
|
public:
|
||||||
CFileStreamReader(CFile& file)
|
CIODeviceStreamReader(CIODevice& device)
|
||||||
: m_file(file)
|
: m_device(device)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
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));
|
ASSERT(nread == sizeof(T));
|
||||||
if (nread != sizeof(T))
|
if (nread != sizeof(T))
|
||||||
m_had_failure = true;
|
m_had_failure = true;
|
||||||
|
@ -26,6 +26,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CFile& m_file;
|
CIODevice& m_device;
|
||||||
bool m_had_failure { false };
|
bool m_had_failure { false };
|
||||||
};
|
};
|
Loading…
Reference in a new issue