1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 08:45:00 +01:00

Extract ShouldIgnoreCase to Platform

This commit is contained in:
Tulio Leao
2021-03-25 23:55:45 -03:00
parent 9a071aef76
commit c7ae064a4c
4 changed files with 12 additions and 5 deletions

View File

@@ -212,11 +212,7 @@ namespace Path
bool Equals(const utf8* a, const utf8* b)
{
bool ignoreCase = false;
#ifdef _WIN32
ignoreCase = true;
#endif
return String::Equals(a, b, ignoreCase);
return String::Equals(a, b, Platform::ShouldIgnoreCase());
}
std::string ResolveCasing(const std::string& path)

View File

@@ -175,6 +175,11 @@ namespace Platform
return lastModified;
}
bool ShouldIgnoreCase()
{
return false;
}
bool IsPathSeparator(char c)
{
return c == '/';

View File

@@ -554,6 +554,11 @@ namespace Platform
return lastModified;
}
bool ShouldIgnoreCase()
{
return true;
}
bool IsPathSeparator(char c)
{
return c == '\\' || c == '/';

View File

@@ -34,6 +34,7 @@ namespace Platform
std::string GetDocsPath();
std::string GetCurrentExecutablePath();
std::string GetCurrentExecutableDirectory();
bool ShouldIgnoreCase();
bool FileExists(const std::string path);
bool IsPathSeparator(char c);
utf8* GetAbsolutePath(utf8* buffer, size_t bufferSize, const utf8* relativePath);