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:
|
2016-06-24 02:43:46 -06:00
|
|
|
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;
|
2016-09-18 10:31:40 -06:00
|
|
|
std::string GetFileName(u64 _Address) override;
|
2016-06-24 02:43:46 -06:00
|
|
|
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;
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2009-07-02 21:26:23 -06:00
|
|
|
private:
|
2016-06-24 02:43:46 -06:00
|
|
|
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;
|
2008-12-07 21:46:09 -07:00
|
|
|
};
|
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
} // namespace
|