Skip to content

Commit

Permalink
Use ToLower util function.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed Nov 6, 2023
1 parent c916b0e commit c87da67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions Source/ui_shared/BootablesProcesses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions tools/PsfPlayer/Source/PsfBase.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "PsfBase.h"
#include "MemStream.h"
#include "StringUtils.h"
#include <assert.h>
#include <string.h>
#include <ctype.h>
Expand Down Expand Up @@ -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())
{
Expand Down

0 comments on commit c87da67

Please sign in to comment.