File: FileSystemGCWii.h

package info (click to toggle)
dolphin-emu 5.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 29,052 kB
  • sloc: cpp: 213,146; java: 6,252; asm: 2,277; xml: 1,998; ansic: 1,514; python: 462; sh: 279; pascal: 247; makefile: 124; perl: 97
file content (50 lines) | stat: -rw-r--r-- 1,510 bytes parent folder | download | duplicates (2)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2008 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#pragma once

#include <cstddef>
#include <string>
#include <vector>

#include "Common/CommonTypes.h"
#include "DiscIO/Filesystem.h"

namespace DiscIO
{

class IVolume;

class CFileSystemGCWii : public IFileSystem
{
public:
	CFileSystemGCWii(const IVolume* _rVolume);
	virtual ~CFileSystemGCWii();

	bool IsValid() const override { return m_Valid; }
	u64 GetFileSize(const std::string& _rFullPath) override;
	const std::vector<SFileInfo>& GetFileList() override;
	const std::string GetFileName(u64 _Address) override;
	u64 ReadFile(const std::string& _rFullPath, u8* _pBuffer, u64 _MaxBufferSize, u64 _OffsetInFile) override;
	bool ExportFile(const std::string& _rFullPath, const std::string&_rExportFilename) override;
	bool ExportApploader(const std::string& _rExportFolder) const override;
	bool ExportDOL(const std::string& _rExportFolder) const override;
	u64 GetBootDOLOffset() const override;
	u32 GetBootDOLSize(u64 dol_offset) const override;

private:
	bool m_Initialized;
	bool m_Valid;
	bool m_Wii;
	std::vector<SFileInfo> m_FileInfoVector;

	std::string GetStringFromOffset(u64 _Offset) const;
	const SFileInfo* FindFileInfo(const std::string& _rFullPath);
	bool DetectFileSystem();
	void InitFileSystem();
	size_t BuildFilenames(const size_t _FirstIndex, const size_t _LastIndex, const std::string& _szDirectory, u64 _NameTableOffset);
	u32 GetOffsetShift() const;
};

} // namespace