Added isDecimalChar() and isHexadecimalChar().

This commit is contained in:
Patrick 2024-09-18 09:46:52 +02:00
parent aff59724fc
commit 24033dbfcc

View File

@ -350,6 +350,22 @@ constexpr bool toNumber(std::basic_string_view<TChar, TTraits> stringView, TNumb
return toNumber(asString, outNumber, base);
}
template<typename TChar>
[[nodiscard]]
constexpr bool isDecimalChar(TChar chr) noexcept
{
return (chr >= TChar('0') && chr <= TChar('9'));
}
template<typename TChar>
[[nodiscard]]
constexpr bool isHexadecimalChar(TChar chr) noexcept
{
return isDecimalChar(chr)
|| (chr >= TChar('A') && chr <= TChar('F'))
|| (chr >= TChar('a') && chr <= TChar('f'));
}
namespace pipe
{
struct Join