mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
More conversion from char * to std::string.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7266 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -201,7 +201,7 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event)
|
||||
if (jit != NULL)
|
||||
{
|
||||
std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt";
|
||||
File::CreateFullPath(filename.c_str());
|
||||
File::CreateFullPath(filename);
|
||||
Profiler::WriteProfileResults(filename.c_str());
|
||||
|
||||
wxFileType* filetype = NULL;
|
||||
@ -254,7 +254,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
|
||||
break;
|
||||
}
|
||||
case IDM_LOADMAPFILE:
|
||||
if (!File::Exists(mapfile.c_str()))
|
||||
if (!File::Exists(mapfile))
|
||||
{
|
||||
g_symbolDB.Clear();
|
||||
PPCAnalyst::FindFunctions(0x81300000, 0x81800000, &g_symbolDB);
|
||||
|
@ -255,7 +255,7 @@ void GFXDebuggerPanel::OnDumpButton(wxCommandEvent& event)
|
||||
{
|
||||
std::string dump_path = File::GetUserPath(D_DUMP_IDX) + "Debug/" +
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID + "/";
|
||||
if (!File::CreateFullPath(dump_path.c_str()))
|
||||
if (!File::CreateFullPath(dump_path))
|
||||
return;
|
||||
|
||||
switch (m_pDumpList->GetSelection())
|
||||
|
@ -677,7 +677,7 @@ void CFrame::DoOpen(bool Boot)
|
||||
{
|
||||
PanicAlertT("Current dir changed from %s to %s after wxFileSelector!",
|
||||
currentDir.c_str(), currentDir2.c_str());
|
||||
File::SetCurrentDir(currentDir.c_str());
|
||||
File::SetCurrentDir(currentDir);
|
||||
}
|
||||
|
||||
if (path.IsEmpty())
|
||||
@ -1641,7 +1641,7 @@ void CFrame::GameListChanged(wxCommandEvent& event)
|
||||
|
||||
for (u32 i = 0; i < rFilenames.size(); i++)
|
||||
{
|
||||
File::Delete(rFilenames[i].c_str());
|
||||
File::Delete(rFilenames[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ void CGameListCtrl::ScanForISOs()
|
||||
for (u32 i = 0; i < Directories.size(); i++)
|
||||
{
|
||||
File::FSTEntry FST_Temp;
|
||||
File::ScanDirectoryTree(Directories[i].c_str(), FST_Temp);
|
||||
File::ScanDirectoryTree(Directories[i], FST_Temp);
|
||||
for (u32 j = 0; j < FST_Temp.children.size(); j++)
|
||||
{
|
||||
if (FST_Temp.children[j].isDirectory)
|
||||
@ -1133,7 +1133,7 @@ void CGameListCtrl::OnDeleteGCM(wxCommandEvent& WXUNUSED (event))
|
||||
if (wxMessageBox(_("Are you sure you want to delete this file? It will be gone forever!"),
|
||||
wxMessageBoxCaptionStr, wxYES_NO | wxICON_EXCLAMATION) == wxYES)
|
||||
{
|
||||
File::Delete(iso->GetFileName().c_str());
|
||||
File::Delete(iso->GetFileName());
|
||||
Update();
|
||||
}
|
||||
}
|
||||
@ -1147,7 +1147,7 @@ void CGameListCtrl::OnDeleteGCM(wxCommandEvent& WXUNUSED (event))
|
||||
for (int i = 0; i < selected; i++)
|
||||
{
|
||||
const GameListItem *iso = GetSelectedISO();
|
||||
File::Delete(iso->GetFileName().c_str());
|
||||
File::Delete(iso->GetFileName());
|
||||
}
|
||||
Update();
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ GameListItem::GameListItem(const std::string& _rFileName)
|
||||
m_Description[i] = "No Description";
|
||||
}
|
||||
m_Country = pVolume->GetCountry();
|
||||
m_FileSize = File::GetSize(_rFileName.c_str());
|
||||
m_FileSize = File::GetSize(_rFileName);
|
||||
m_VolumeSize = pVolume->GetSize();
|
||||
|
||||
m_UniqueID = pVolume->GetUniqueID();
|
||||
@ -153,9 +153,9 @@ bool GameListItem::LoadFromCache()
|
||||
|
||||
void GameListItem::SaveToCache()
|
||||
{
|
||||
if (!File::IsDirectory(File::GetUserPath(D_CACHE_IDX).c_str()))
|
||||
if (!File::IsDirectory(File::GetUserPath(D_CACHE_IDX)))
|
||||
{
|
||||
File::CreateDir(File::GetUserPath(D_CACHE_IDX).c_str());
|
||||
File::CreateDir(File::GetUserPath(D_CACHE_IDX));
|
||||
}
|
||||
|
||||
CChunkFileReader::Save<GameListItem>(CreateCacheFilename(), CACHE_REVISION, *this);
|
||||
@ -188,7 +188,7 @@ std::string GameListItem::CreateCacheFilename()
|
||||
// Append hash to prevent ISO name-clashing in different folders.
|
||||
Filename.append(StringFromFormat("%s_%x_%llx.cache",
|
||||
extension.c_str(), HashFletcher((const u8 *)LegalPathname.c_str(), LegalPathname.size()),
|
||||
File::GetSize(m_FileName.c_str())));
|
||||
File::GetSize(m_FileName)));
|
||||
|
||||
std::string fullname(File::GetUserPath(D_CACHE_IDX));
|
||||
fullname += Filename;
|
||||
|
@ -591,7 +591,7 @@ void GamepadPage::LoadProfile(wxCommandEvent&)
|
||||
std::string fname;
|
||||
GamepadPage::GetProfilePath(fname);
|
||||
|
||||
if (false == File::Exists(fname.c_str()))
|
||||
if (false == File::Exists(fname))
|
||||
return;
|
||||
|
||||
IniFile inifile;
|
||||
@ -609,7 +609,7 @@ void GamepadPage::SaveProfile(wxCommandEvent&)
|
||||
{
|
||||
std::string fname;
|
||||
GamepadPage::GetProfilePath(fname);
|
||||
File::CreateFullPath(fname.c_str());
|
||||
File::CreateFullPath(fname);
|
||||
|
||||
if (false == fname.empty())
|
||||
{
|
||||
|
@ -202,7 +202,7 @@ bool DolphinApp::OnInit()
|
||||
|
||||
#ifdef _WIN32
|
||||
// Keep the user config dir free unless user wants to save the working dir
|
||||
if (!File::Exists((File::GetUserPath(D_CONFIG_IDX) + "portable").c_str()))
|
||||
if (!File::Exists(File::GetUserPath(D_CONFIG_IDX) + "portable"))
|
||||
{
|
||||
char tmp[1024];
|
||||
sprintf(tmp, "%s/.dolphin%swd", (const char*)wxStandardPaths::Get().GetUserConfigDir().mb_str(),
|
||||
@ -263,35 +263,35 @@ bool DolphinApp::OnInit()
|
||||
#else
|
||||
//create all necessary directories in user directory
|
||||
//TODO : detect the revision and upgrade where necessary
|
||||
File::CopyDir(std::string(SHARED_USER_DIR CONFIG_DIR DIR_SEP).c_str(),
|
||||
File::GetUserPath(D_CONFIG_IDX).c_str());
|
||||
File::CopyDir(std::string(SHARED_USER_DIR GAMECONFIG_DIR DIR_SEP).c_str(),
|
||||
File::GetUserPath(D_GAMECONFIG_IDX).c_str());
|
||||
File::CopyDir(std::string(SHARED_USER_DIR MAPS_DIR DIR_SEP).c_str(),
|
||||
File::GetUserPath(D_MAPS_IDX).c_str());
|
||||
File::CopyDir(std::string(SHARED_USER_DIR SHADERS_DIR DIR_SEP).c_str(),
|
||||
File::GetUserPath(D_SHADERS_IDX).c_str());
|
||||
File::CopyDir(std::string(SHARED_USER_DIR WII_USER_DIR DIR_SEP).c_str(),
|
||||
File::GetUserPath(D_WIIUSER_IDX).c_str());
|
||||
File::CopyDir(std::string(SHARED_USER_DIR OPENCL_DIR DIR_SEP).c_str(),
|
||||
File::GetUserPath(D_OPENCL_IDX).c_str());
|
||||
File::CopyDir(std::string(SHARED_USER_DIR CONFIG_DIR DIR_SEP),
|
||||
File::GetUserPath(D_CONFIG_IDX));
|
||||
File::CopyDir(std::string(SHARED_USER_DIR GAMECONFIG_DIR DIR_SEP),
|
||||
File::GetUserPath(D_GAMECONFIG_IDX));
|
||||
File::CopyDir(std::string(SHARED_USER_DIR MAPS_DIR DIR_SEP),
|
||||
File::GetUserPath(D_MAPS_IDX));
|
||||
File::CopyDir(std::string(SHARED_USER_DIR SHADERS_DIR DIR_SEP),
|
||||
File::GetUserPath(D_SHADERS_IDX));
|
||||
File::CopyDir(std::string(SHARED_USER_DIR WII_USER_DIR DIR_SEP),
|
||||
File::GetUserPath(D_WIIUSER_IDX));
|
||||
File::CopyDir(std::string(SHARED_USER_DIR OPENCL_DIR DIR_SEP),
|
||||
File::GetUserPath(D_OPENCL_IDX));
|
||||
|
||||
if (!File::Exists(File::GetUserPath(D_GCUSER_IDX).c_str()))
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX).c_str());
|
||||
if (!File::Exists(File::GetUserPath(D_CACHE_IDX).c_str()))
|
||||
File::CreateFullPath(File::GetUserPath(D_CACHE_IDX).c_str());
|
||||
if (!File::Exists(File::GetUserPath(D_DUMPDSP_IDX).c_str()))
|
||||
File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX).c_str());
|
||||
if (!File::Exists(File::GetUserPath(D_DUMPTEXTURES_IDX).c_str()))
|
||||
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX).c_str());
|
||||
if (!File::Exists(File::GetUserPath(D_HIRESTEXTURES_IDX).c_str()))
|
||||
File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX).c_str());
|
||||
if (!File::Exists(File::GetUserPath(D_SCREENSHOTS_IDX).c_str()))
|
||||
File::CreateFullPath(File::GetUserPath(D_SCREENSHOTS_IDX).c_str());
|
||||
if (!File::Exists(File::GetUserPath(D_STATESAVES_IDX).c_str()))
|
||||
File::CreateFullPath(File::GetUserPath(D_STATESAVES_IDX).c_str());
|
||||
if (!File::Exists(File::GetUserPath(D_MAILLOGS_IDX).c_str()))
|
||||
File::CreateFullPath(File::GetUserPath(D_MAILLOGS_IDX).c_str());
|
||||
if (!File::Exists(File::GetUserPath(D_GCUSER_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_CACHE_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_CACHE_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_DUMPDSP_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_DUMPTEXTURES_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_HIRESTEXTURES_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_SCREENSHOTS_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_SCREENSHOTS_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_STATESAVES_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_STATESAVES_IDX));
|
||||
if (!File::Exists(File::GetUserPath(D_MAILLOGS_IDX)))
|
||||
File::CreateFullPath(File::GetUserPath(D_MAILLOGS_IDX));
|
||||
#endif
|
||||
|
||||
LogManager::Init();
|
||||
@ -374,14 +374,13 @@ void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event))
|
||||
if (main_frame->g_pCodeWindow->AutomaticStart())
|
||||
{
|
||||
if(!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty()
|
||||
&& File::Exists(SConfig::GetInstance().m_LocalCoreStartupParameter.
|
||||
m_strDefaultGCM.c_str()))
|
||||
&& File::Exists(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM))
|
||||
{
|
||||
main_frame->BootGame(SConfig::GetInstance().m_LocalCoreStartupParameter.
|
||||
m_strDefaultGCM);
|
||||
}
|
||||
else if(!SConfig::GetInstance().m_LastFilename.empty()
|
||||
&& File::Exists(SConfig::GetInstance().m_LastFilename.c_str()))
|
||||
&& File::Exists(SConfig::GetInstance().m_LastFilename))
|
||||
{
|
||||
main_frame->BootGame(SConfig::GetInstance().m_LastFilename);
|
||||
}
|
||||
@ -394,7 +393,7 @@ void DolphinApp::InitLanguageSupport()
|
||||
unsigned int language = 0;
|
||||
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
|
||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
ini.Get("Interface", "Language", &language, wxLANGUAGE_DEFAULT);
|
||||
|
||||
// Load language if possible, fall back to system default otherwise
|
||||
|
@ -569,7 +569,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
|
||||
{
|
||||
if (!CopyDeleteSwitch(memoryCard[slot]->ExportGci(index, fileName.mb_str(), NULL), -1))
|
||||
{
|
||||
File::Delete(fileName.mb_str());
|
||||
File::Delete(std::string(fileName.mb_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -582,7 +582,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
|
||||
mpath = m_MemcardPath[slot]->GetPath().mb_str();
|
||||
SplitPath(mpath, &path1, &path2, NULL);
|
||||
path1 += path2;
|
||||
File::CreateDir(path1.c_str());
|
||||
File::CreateDir(path1);
|
||||
if(PanicYesNoT("Warning: This will overwrite any existing saves that are in the folder:\n"
|
||||
"%s\nand have the same name as a file on your memcard\nContinue?", path1.c_str()))
|
||||
for (int i = 0; i < DIRLEN; i++)
|
||||
|
@ -350,15 +350,15 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
std::string __name, __ext;
|
||||
memset(&tmpFileHDR, 0, FILE_HDR_SZ);
|
||||
|
||||
_fileSize = File::GetSize(FilesList.at(i).c_str());
|
||||
_fileSize = File::GetSize(FilesList[i]);
|
||||
_roundedfileSize = ROUND_UP(_fileSize, BLOCK_SZ);
|
||||
|
||||
tmpFileHDR.magic = Common::swap32(FILE_HDR_MAGIC);
|
||||
tmpFileHDR.size = Common::swap32(_fileSize);
|
||||
tmpFileHDR.Permissions = 0x3C;
|
||||
tmpFileHDR.type = File::IsDirectory(FilesList.at(i).c_str()) ? 2 : 1;
|
||||
tmpFileHDR.type = File::IsDirectory(FilesList[i]) ? 2 : 1;
|
||||
|
||||
SplitPath(FilesList.at(i), NULL, &__name, &__ext);
|
||||
SplitPath(FilesList[i], NULL, &__name, &__ext);
|
||||
__name += __ext;
|
||||
|
||||
|
||||
@ -392,14 +392,14 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
{
|
||||
if (_fileSize == 0)
|
||||
{
|
||||
PanicAlertT("%s is a 0 byte file", FilesList.at(i).c_str());
|
||||
PanicAlertT("%s is a 0 byte file", FilesList[i].c_str());
|
||||
b_valid = false;
|
||||
return;
|
||||
}
|
||||
fpRawSaveFile = fopen(FilesList.at(i).c_str(), "rb");
|
||||
fpRawSaveFile = fopen(FilesList[i].c_str(), "rb");
|
||||
if (!fpRawSaveFile)
|
||||
{
|
||||
PanicAlertT("%s failed to open", FilesList.at(i).c_str());
|
||||
PanicAlertT("%s failed to open", FilesList[i].c_str());
|
||||
b_valid = false;
|
||||
}
|
||||
__data = new u8[_roundedfileSize];
|
||||
@ -407,7 +407,7 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
|
||||
memset(__data, 0, _roundedfileSize);
|
||||
if (fread(__data, _fileSize, 1, fpRawSaveFile) != 1)
|
||||
{
|
||||
PanicAlertT("failed to read data from file: %s", FilesList.at(i).c_str());
|
||||
PanicAlertT("failed to read data from file: %s", FilesList[i].c_str());
|
||||
b_valid = false;
|
||||
}
|
||||
fclose(fpRawSaveFile);
|
||||
@ -564,10 +564,10 @@ void CWiiSaveCrypted::ScanForFiles(std::string savDir, std::vector<std::string>&
|
||||
Directories.push_back(savDir);
|
||||
for (u32 i = 0; i < Directories.size(); i++)
|
||||
{
|
||||
if (i) FileList.push_back(Directories.at(i));//add dir to fst
|
||||
if (i) FileList.push_back(Directories[i]);//add dir to fst
|
||||
|
||||
File::FSTEntry FST_Temp;
|
||||
File::ScanDirectoryTree(Directories.at(i).c_str(), FST_Temp);
|
||||
File::ScanDirectoryTree(Directories[i], FST_Temp);
|
||||
for (u32 j = 0; j < FST_Temp.children.size(); j++)
|
||||
{
|
||||
if (strncmp(FST_Temp.children.at(j).virtualName.c_str(), "banner.bin", 10) != 0)
|
||||
|
Reference in New Issue
Block a user