diff --git a/Source/ui_shared/BootablesProcesses.cpp b/Source/ui_shared/BootablesProcesses.cpp index 09a1ba3343..bf3afb13e0 100644 --- a/Source/ui_shared/BootablesProcesses.cpp +++ b/Source/ui_shared/BootablesProcesses.cpp @@ -5,6 +5,7 @@ #include "TheGamesDbClient.h" #include "DiskUtils.h" #include "PathUtils.h" +#include "StringUtils.h" #include "string_format.h" #include "StdStreamUtils.h" #include "http/HttpClientFactory.h" @@ -39,16 +40,14 @@ static void BootableLog(const char* format, ...) bool IsBootableExecutablePath(const fs::path& filePath) { - auto extension = filePath.extension().string(); - std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); + auto extension = StringUtils::ToLower(filePath.extension().string()); return (extension == ".elf"); } bool IsBootableDiscImagePath(const fs::path& filePath) { const auto& supportedExtensions = DiskUtils::GetSupportedExtensions(); - auto extension = filePath.extension().string(); - std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); + auto extension = StringUtils::ToLower(filePath.extension().string()); auto extensionIterator = supportedExtensions.find(extension); return extensionIterator != std::end(supportedExtensions); } diff --git a/tools/PsfPlayer/Source/PsfBase.cpp b/tools/PsfPlayer/Source/PsfBase.cpp index cacf7f15d9..84dd774fab 100644 --- a/tools/PsfPlayer/Source/PsfBase.cpp +++ b/tools/PsfPlayer/Source/PsfBase.cpp @@ -1,5 +1,6 @@ #include "PsfBase.h" #include "MemStream.h" +#include "StringUtils.h" #include #include #include @@ -157,9 +158,8 @@ void CPsfBase::ReadTags(CStream& stream) const char* tagEnd = tagBegin + line.length(); if(tagSeparator != NULL) { - std::string tagName = std::string(tagBegin, tagSeparator); + std::string tagName = StringUtils::ToLower(std::string(tagBegin, tagSeparator)); std::string tagValue = std::string(tagSeparator + 1, tagEnd); - std::transform(tagName.begin(), tagName.end(), tagName.begin(), tolower); TagMap::iterator tagIterator(m_tags.find(tagName)); if(tagIterator != m_tags.end()) {