mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Wrapped fopen/close/read/write functions inside a simple "IOFile" class. Reading, writing, and error checking became simpler in most cases. It should be near impossible to forget to close a file now that the destructor takes care of it. (I hope this fixes Issue 3635) I have tested the functionality of most things, but it is possible I broke something. :p
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7328 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -19,23 +19,23 @@
|
||||
#define _FILE_BLOB_H
|
||||
|
||||
#include "Blob.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include "FileUtil.h"
|
||||
|
||||
namespace DiscIO
|
||||
{
|
||||
|
||||
class PlainFileReader : public IBlobReader
|
||||
{
|
||||
FILE* file_;
|
||||
PlainFileReader(FILE* file__);
|
||||
s64 size;
|
||||
PlainFileReader(std::FILE* file);
|
||||
|
||||
File::IOFile m_file;
|
||||
s64 m_size;
|
||||
|
||||
public:
|
||||
static PlainFileReader* Create(const char* filename);
|
||||
~PlainFileReader();
|
||||
u64 GetDataSize() const { return size; }
|
||||
u64 GetRawSize() const { return size; }
|
||||
|
||||
u64 GetDataSize() const { return m_size; }
|
||||
u64 GetRawSize() const { return m_size; }
|
||||
bool Read(u64 offset, u64 nbytes, u8* out_ptr);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user