Experimental support for dumping all files from a gcm

supports partition 0 on wii discs (disabled) and will fail on dir structures that are too deep
no progress bar yet, so it looks like dolphin does not respond while dumping

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4254 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99
2009-09-12 09:09:47 +00:00
parent 674334f53e
commit e31cc7d1fe
3 changed files with 69 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#include "stdafx.h"
#include "Common.h"
#include "FileUtil.h"
#include <string>
@ -117,6 +118,52 @@ bool CFileSystemGCWii::ExportFile(const char* _rFullPath, const char* _rExportFi
bool CFileSystemGCWii::ExportAllFiles(const char* _rFullPath) const
{
std::vector<const SFileInfo *> fst;
char exportName[512];
GetFileList(fst);
for (u64 i = 1; i < fst.size(); i++)
{
if (fst[i]->IsDirectory())
{
sprintf(exportName, "%s/%s/", _rFullPath, fst[i]->m_FullPath);
DEBUG_LOG(DISCIO, "%s", exportName);
if (!File::Exists(exportName))
{
if (!File::CreateFullPath(exportName))
{
ERROR_LOG(DISCIO, "Could not create the path %s", exportName);
return false;
}
}
else
{
if (!File::IsDirectory(exportName))
{
ERROR_LOG(DISCIO, "%s already exists and is not a directory", exportName);
return false;
}
DEBUG_LOG(DISCIO, "folder %s already exists", exportName);
}
}
else
{
sprintf(exportName, "%s/%s", _rFullPath, fst[i]->m_FullPath);
DEBUG_LOG(DISCIO, "%s", exportName);
if (!File::Exists(exportName))
{
if (!ExportFile(fst[i]->m_FullPath, exportName))
ERROR_LOG(DISCIO, "Could not export %s", exportName);
}
else
{
DEBUG_LOG(DISCIO, "%s already exists", exportName);
}
}
}
return false;
}