mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Kill off some usages of c_str.
Also changes some function params, but this is ok. Some simplifications were also able to be made (ie. killing off strcmps with ==, etc).
This commit is contained in:
@ -33,7 +33,7 @@ CFileSystemGCWii::~CFileSystemGCWii()
|
||||
m_FileInfoVector.clear();
|
||||
}
|
||||
|
||||
u64 CFileSystemGCWii::GetFileSize(const char* _rFullPath)
|
||||
u64 CFileSystemGCWii::GetFileSize(const std::string& _rFullPath)
|
||||
{
|
||||
if (!m_Initialized)
|
||||
InitFileSystem();
|
||||
@ -63,7 +63,7 @@ const char* CFileSystemGCWii::GetFileName(u64 _Address)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
u64 CFileSystemGCWii::ReadFile(const char* _rFullPath, u8* _pBuffer, size_t _MaxBufferSize)
|
||||
u64 CFileSystemGCWii::ReadFile(const std::string& _rFullPath, u8* _pBuffer, size_t _MaxBufferSize)
|
||||
{
|
||||
if (!m_Initialized)
|
||||
InitFileSystem();
|
||||
@ -75,14 +75,14 @@ u64 CFileSystemGCWii::ReadFile(const char* _rFullPath, u8* _pBuffer, size_t _Max
|
||||
if (pFileInfo->m_FileSize > _MaxBufferSize)
|
||||
return 0;
|
||||
|
||||
DEBUG_LOG(DISCIO, "Filename: %s. Offset: %" PRIx64 ". Size: %" PRIx64, _rFullPath,
|
||||
DEBUG_LOG(DISCIO, "Filename: %s. Offset: %" PRIx64 ". Size: %" PRIx64, _rFullPath.c_str(),
|
||||
pFileInfo->m_Offset, pFileInfo->m_FileSize);
|
||||
|
||||
m_rVolume->Read(pFileInfo->m_Offset, pFileInfo->m_FileSize, _pBuffer);
|
||||
return pFileInfo->m_FileSize;
|
||||
}
|
||||
|
||||
bool CFileSystemGCWii::ExportFile(const char* _rFullPath, const char* _rExportFilename)
|
||||
bool CFileSystemGCWii::ExportFile(const std::string& _rFullPath, const std::string& _rExportFilename)
|
||||
{
|
||||
if (!m_Initialized)
|
||||
InitFileSystem();
|
||||
@ -122,7 +122,7 @@ bool CFileSystemGCWii::ExportFile(const char* _rFullPath, const char* _rExportFi
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CFileSystemGCWii::ExportApploader(const char* _rExportFolder) const
|
||||
bool CFileSystemGCWii::ExportApploader(const std::string& _rExportFolder) const
|
||||
{
|
||||
u32 AppSize = Read32(0x2440 + 0x14);// apploader size
|
||||
AppSize += Read32(0x2440 + 0x18); // + trailer size
|
||||
@ -177,7 +177,7 @@ bool CFileSystemGCWii::GetBootDOL(u8* &buffer, u32 DolSize) const
|
||||
return m_rVolume->Read(DolOffset, DolSize, buffer);
|
||||
}
|
||||
|
||||
bool CFileSystemGCWii::ExportDOL(const char* _rExportFolder) const
|
||||
bool CFileSystemGCWii::ExportDOL(const std::string& _rExportFolder) const
|
||||
{
|
||||
u32 DolOffset = Read32(0x420) << m_OffsetShift;
|
||||
u32 DolSize = GetBootDOLSize();
|
||||
@ -232,14 +232,14 @@ size_t CFileSystemGCWii::GetFileList(std::vector<const SFileInfo *> &_rFilenames
|
||||
return m_FileInfoVector.size();
|
||||
}
|
||||
|
||||
const SFileInfo* CFileSystemGCWii::FindFileInfo(const char* _rFullPath)
|
||||
const SFileInfo* CFileSystemGCWii::FindFileInfo(const std::string& _rFullPath)
|
||||
{
|
||||
if (!m_Initialized)
|
||||
InitFileSystem();
|
||||
|
||||
for (auto& fileInfo : m_FileInfoVector)
|
||||
{
|
||||
if (!strcasecmp(fileInfo.m_FullPath, _rFullPath))
|
||||
if (!strcasecmp(fileInfo.m_FullPath, _rFullPath.c_str()))
|
||||
return &fileInfo;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user