1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Get new manager showing in window

This commit is contained in:
Ted John
2020-07-15 00:40:29 +01:00
parent 28aead5cb5
commit e5f263a0fc
7 changed files with 387 additions and 181 deletions

View File

@@ -199,7 +199,42 @@ namespace String
bool Equals(const std::string& a, const std::string& b, bool ignoreCase)
{
return Equals(a.c_str(), b.c_str(), ignoreCase);
if (a.size() != b.size())
return false;
if (ignoreCase)
{
for (size_t i = 0; i < a.size(); i++)
{
auto ai = a[i];
auto bi = b[i];
// Only do case insensitive comparison on ASCII characters
if ((ai & 0x80) != 0 || (bi & 0x80) != 0)
{
if (a[i] != b[i])
{
return false;
}
}
else if (tolower(ai) != tolower(bi))
{
return false;
}
}
}
else
{
for (size_t i = 0; i < a.size(); i++)
{
if (a[i] != b[i])
{
return false;
}
}
}
return true;
}
bool Equals(const utf8* a, const utf8* b, bool ignoreCase)