dolphin/Source/Core/DiscIO/FileBlob.cpp
Tillmann Karras d802d39281 clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-03-09 21:14:26 +01:00

32 lines
602 B
C++

// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#include "DiscIO/FileBlob.h"
namespace DiscIO
{
PlainFileReader::PlainFileReader(std::FILE* file)
: m_file(file)
{
m_size = m_file.GetSize();
}
PlainFileReader* PlainFileReader::Create(const char* filename)
{
File::IOFile f(filename, "rb");
if (f)
return new PlainFileReader(f.ReleaseHandle());
else
return nullptr;
}
bool PlainFileReader::Read(u64 offset, u64 nbytes, u8* out_ptr)
{
m_file.Seek(offset, SEEK_SET);
return m_file.ReadBytes(out_ptr, nbytes);
}
} // namespace