1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 22:34:33 +01:00

Develop new imaging code

This commit is contained in:
Ted John
2018-05-07 21:32:24 +01:00
parent 4552f6a405
commit 766997f15c
4 changed files with 250 additions and 163 deletions

View File

@@ -160,6 +160,16 @@ namespace String
return StartsWith(str.c_str(), match.c_str(), ignoreCase);
}
bool EndsWith(const std::string_view& str, const std::string_view& match, bool ignoreCase)
{
if (str.size() >= match.size())
{
auto view = str.substr(str.size() - match.size());
return Equals(view.data(), match.data(), ignoreCase);
}
return false;
}
size_t IndexOf(const utf8 * str, utf8 match, size_t startIndex)
{
const utf8 * ch = str + startIndex;