1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 16:24:35 +01:00

Create new templated format string

This commit is contained in:
Ted John
2020-10-09 00:50:08 +01:00
parent 79c6b22600
commit 14377be487
9 changed files with 466 additions and 8 deletions

View File

@@ -154,6 +154,32 @@ namespace String
}
}
bool Equals(const std::string_view& a, const std::string_view& b, bool ignoreCase)
{
if (ignoreCase)
{
if (a.size() == b.size())
{
for (size_t i = 0; i < a.size(); i++)
{
if (tolower(a[i]) != tolower(b[i]))
{
return false;
}
}
return true;
}
else
{
return false;
}
}
else
{
return a == b;
}
}
bool Equals(const std::string& a, const std::string& b, bool ignoreCase)
{
return Equals(a.c_str(), b.c_str(), ignoreCase);