diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2014-03-15 00:57:56 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2014-03-15 00:57:56 +0100 |
| commit | 8d679e76d299956a1521bc14502466be8d8b2df8 (patch) | |
| tree | 97db9ad6a45a8e5d711d7763199579e400a65bc8 /Source/Core/DolphinWX/ISOFile.cpp | |
| parent | 12c2e345a35a571aadc842e30c38b3b4d8f70dce (diff) | |
| parent | a82675b7d581421fa80d5d5c53253cf1d5c1a26d (diff) | |
Merge pull request #164 from lioncash/cstr-cull
Kill off some usages of c_str.
Diffstat (limited to 'Source/Core/DolphinWX/ISOFile.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/ISOFile.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index 81a2f49593..63c30f10bb 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -73,7 +73,7 @@ GameListItem::GameListItem(const std::string& _rFileName) m_VolumeSize = pVolume->GetSize(); m_UniqueID = pVolume->GetUniqueID(); - m_BlobCompressed = DiscIO::IsCompressedBlob(_rFileName.c_str()); + m_BlobCompressed = DiscIO::IsCompressedBlob(_rFileName); m_IsDiscTwo = pVolume->IsDiscTwo(); m_Revision = pVolume->GetRevision(); @@ -278,32 +278,31 @@ std::string GameListItem::GetName(int _index) const const std::string GameListItem::GetWiiFSPath() const { - DiscIO::IVolume *Iso = DiscIO::CreateVolumeFromFilename(m_FileName); + DiscIO::IVolume *iso = DiscIO::CreateVolumeFromFilename(m_FileName); std::string ret; - if (Iso == nullptr) + if (iso == nullptr) return ret; - if (DiscIO::IsVolumeWiiDisc(Iso) || DiscIO::IsVolumeWadFile(Iso)) + if (DiscIO::IsVolumeWiiDisc(iso) || DiscIO::IsVolumeWadFile(iso)) { - char Path[250]; - u64 Title; + u64 title; - Iso->GetTitleID((u8*)&Title); - Title = Common::swap64(Title); + iso->GetTitleID((u8*)&title); + title = Common::swap64(title); - sprintf(Path, "%stitle/%08x/%08x/data/", - File::GetUserPath(D_WIIUSER_IDX).c_str(), (u32)(Title>>32), (u32)Title); + const std::string path = StringFromFormat("%stitle/%08x/%08x/data/", + File::GetUserPath(D_WIIUSER_IDX).c_str(), (u32)(title>>32), (u32)title); - if (!File::Exists(Path)) - File::CreateFullPath(Path); + if (!File::Exists(path)) + File::CreateFullPath(path); - if (Path[0] == '.') - ret = WxStrToStr(wxGetCwd()) + std::string(Path).substr(strlen(ROOT_DIR)); + if (path[0] == '.') + ret = WxStrToStr(wxGetCwd()) + path.substr(strlen(ROOT_DIR)); else - ret = std::string(Path); + ret = path; } - delete Iso; + delete iso; return ret; } |
