StringUtil: More Wrappers For <cctype>

`Common::IsLower(char)` was omitted as nothing needed it.
This commit is contained in:
mitaclaw
2024-08-22 21:23:58 -07:00
parent b4a1967310
commit 826e2bbf98
6 changed files with 21 additions and 10 deletions

View File

@ -275,6 +275,21 @@ inline bool IsAlpha(char c)
return std::isalpha(c, std::locale::classic());
}
inline bool IsAlnum(char c)
{
return std::isalnum(c, std::locale::classic());
}
inline bool IsUpper(char c)
{
return std::isupper(c, std::locale::classic());
}
inline bool IsXDigit(char c)
{
return std::isxdigit(c /* no locale needed */) != 0;
}
inline char ToLower(char ch)
{
return std::tolower(ch, std::locale::classic());