QtMiscUtils: add isAsciiDigit helper
This logic is used in various places in qtbase, put it in one place. Change-Id: I731b1ce0c7b38fd42a91799a0565aafa94d4e9d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
763884cfb7
commit
a4f18c6d0d
@ -49,6 +49,11 @@ constexpr inline int fromOct(uint c) noexcept
|
||||
return ((c >= '0') && (c <= '7')) ? int(c - '0') : -1;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr inline bool isAsciiDigit(uchar c) noexcept
|
||||
{
|
||||
return c >= '0' && c <= '9';
|
||||
}
|
||||
|
||||
constexpr inline char toAsciiLower(char ch) noexcept
|
||||
{
|
||||
return (ch >= 'A' && ch <= 'Z') ? ch - 'A' + 'a' : ch;
|
||||
|
Loading…
Reference in New Issue
Block a user