Common: Replace StringBeginsWith/StringEndsWith with std equivalents

Obsoletes these functions in favor of the standard member functions
added in C++20.
This commit is contained in:
Lioncash
2023-01-24 14:25:49 -05:00
parent ba6ee9d7ba
commit e5b91f00b0
21 changed files with 57 additions and 97 deletions

View File

@ -642,7 +642,7 @@ void Init(const std::string& game_id)
{
hasbind = true;
type = BIND_AXIS;
if (StringBeginsWith(value, "Device ''"))
if (value.starts_with("Device ''"))
sscanf(value.c_str(), "Device ''-Axis %d%c", &bindnum, &modifier);
else
sscanf(value.c_str(), "Device '%127[^\']'-Axis %d%c", dev, &bindnum, &modifier);
@ -651,7 +651,7 @@ void Init(const std::string& game_id)
{
hasbind = true;
type = BIND_BUTTON;
if (StringBeginsWith(value, "Device ''"))
if (value.starts_with("Device ''"))
sscanf(value.c_str(), "Device ''-Button %d", &bindnum);
else
sscanf(value.c_str(), "Device '%127[^\']'-Button %d", dev, &bindnum);