summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/FileBlob.h
blob: 92135de2afe10c38e1fc5fd9be71f269e763f0d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2008 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#pragma once

#include <cstdio>
#include <string>

#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "DiscIO/Blob.h"

namespace DiscIO
{

class PlainFileReader : public IBlobReader
{
public:
	static PlainFileReader* Create(const std::string& filename);

	u64 GetDataSize() const override { return m_size; }
	u64 GetRawSize() const override { return m_size; }
	bool Read(u64 offset, u64 nbytes, u8* out_ptr) override;

private:
	PlainFileReader(std::FILE* file);

	File::IOFile m_file;
	s64 m_size;
};

}  // namespace