2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 21:09:55 -06:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2014-02-20 17:47:53 -07:00
|
|
|
#include <cstddef>
|
|
|
|
#include <string>
|
2008-12-07 21:46:09 -07:00
|
|
|
#include <vector>
|
|
|
|
|
2014-02-20 17:47:53 -07:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "DiscIO/Filesystem.h"
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
|
|
namespace DiscIO
|
|
|
|
{
|
|
|
|
|
2014-02-20 17:47:53 -07:00
|
|
|
class IVolume;
|
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
class CFileSystemGCWii : public IFileSystem
|
|
|
|
{
|
|
|
|
public:
|
2013-03-03 15:51:26 -07:00
|
|
|
CFileSystemGCWii(const IVolume* _rVolume);
|
2008-12-07 21:46:09 -07:00
|
|
|
virtual ~CFileSystemGCWii();
|
2015-07-30 04:47:02 -06:00
|
|
|
|
|
|
|
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;
|
2015-10-03 05:24:13 -06:00
|
|
|
u64 GetBootDOLOffset() const override;
|
2015-10-17 12:52:26 -06:00
|
|
|
u32 GetBootDOLSize(u64 dol_offset) const override;
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2009-07-02 21:26:23 -06:00
|
|
|
private:
|
2008-12-07 21:46:09 -07:00
|
|
|
bool m_Initialized;
|
2010-06-03 14:59:55 -06:00
|
|
|
bool m_Valid;
|
2014-12-28 02:35:48 -07:00
|
|
|
bool m_Wii;
|
2015-05-03 03:39:20 -06:00
|
|
|
std::vector<SFileInfo> m_FileInfoVector;
|
2013-10-28 23:23:17 -06:00
|
|
|
|
2013-03-03 15:51:26 -07:00
|
|
|
std::string GetStringFromOffset(u64 _Offset) const;
|
2014-03-12 13:33:41 -06:00
|
|
|
const SFileInfo* FindFileInfo(const std::string& _rFullPath);
|
2010-06-03 14:37:32 -06:00
|
|
|
bool DetectFileSystem();
|
|
|
|
void InitFileSystem();
|
2014-03-14 21:38:14 -06:00
|
|
|
size_t BuildFilenames(const size_t _FirstIndex, const size_t _LastIndex, const std::string& _szDirectory, u64 _NameTableOffset);
|
2014-12-28 02:35:48 -07:00
|
|
|
u32 GetOffsetShift() const;
|
2008-12-07 21:46:09 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|