util/CharUtil: add ToLowerASCII()

This commit is contained in:
Max Kellermann 2014-08-11 18:42:05 +02:00
parent e8a5a9b1e8
commit 2ccfb71d12

View File

@ -126,4 +126,17 @@ ToUpperASCII(char ch)
: ch;
}
/**
* Convert the specified ASCII character (0x00..0x7f) to lower case.
* Unlike toupper(), it ignores the system locale.
*/
constexpr
static inline char
ToLowerASCII(char ch)
{
return ch >= 'A' && ch <= 'Z'
? (ch + ('a' - 'A'))
: ch;
}
#endif