24 #ifndef INCLUDED_RTL_CHARACTER_HXX
25 #define INCLUDED_RTL_CHARACTER_HXX
60 #if defined LIBO_INTERNAL_ONLY
62 bool isAscii(
signed char) =
delete;
63 template <
typename T>
inline constexpr
bool isAscii(T code) {
return isAscii(sal_uInt32(code)); }
78 return code >=
'a' && code <=
'z';
81 #if defined LIBO_INTERNAL_ONLY
102 return code >=
'A' && code <=
'Z';
105 #if defined LIBO_INTERNAL_ONLY
129 #if defined LIBO_INTERNAL_ONLY
132 template <
typename T>
inline constexpr
bool isAsciiAlpha(T code)
150 return code >=
'0' && code <=
'9';
153 #if defined LIBO_INTERNAL_ONLY
156 template <
typename T>
inline constexpr
bool isAsciiDigit(T code)
177 #if defined LIBO_INTERNAL_ONLY
198 return isAsciiDigit(code) || (code >=
'A' && code <=
'F');
201 #if defined LIBO_INTERNAL_ONLY
225 #if defined LIBO_INTERNAL_ONLY
245 return code >=
'0' && code <=
'7';
248 #if defined LIBO_INTERNAL_ONLY
269 return code ==
' ' || code ==
'\f' || code ==
'\n' || code ==
'\r' || code ==
'\t'
273 #if defined LIBO_INTERNAL_ONLY
296 #if defined LIBO_INTERNAL_ONLY
319 #if defined LIBO_INTERNAL_ONLY
351 sal_uInt32
const surrogatesHighFirst = 0xD800;
352 sal_uInt32
const surrogatesHighLast = 0xDBFF;
353 sal_uInt32
const surrogatesLowFirst = 0xDC00;
354 sal_uInt32
const surrogatesLowLast = 0xDFFF;
369 return code >= detail::surrogatesHighFirst && code <= detail::surrogatesLowLast;
383 return code >= detail::surrogatesHighFirst && code <= detail::surrogatesHighLast;
397 return code >= detail::surrogatesLowFirst && code <= detail::surrogatesLowLast;
411 assert(code >= 0x10000);
412 return static_cast<sal_Unicode>(((code - 0x10000) >> 10) | detail::surrogatesHighFirst);
426 assert(code >= 0x10000);
427 return static_cast<sal_Unicode>(((code - 0x10000) & 0x3FF) | detail::surrogatesLowFirst);
444 return ((high - detail::surrogatesHighFirst) << 10) + (low - detail::surrogatesLowFirst)
463 assert(output != NULL);
#define SAL_CONSTEXPR
C++11 "constexpr" feature.
Definition: types.h:404
SAL_CONSTEXPR bool isAscii(sal_uInt32 code)
Check for ASCII character.
Definition: character.hxx:54
SAL_CONSTEXPR bool isAsciiAlpha(sal_uInt32 code)
Check for ASCII alphabetic character.
Definition: character.hxx:123
SAL_CONSTEXPR bool isUnicodeCodePoint(sal_uInt32 code)
Check for Unicode code point.
Definition: character.hxx:44
SAL_CONSTEXPR sal_Int32 compareIgnoreAsciiCase(sal_uInt32 code1, sal_uInt32 code2)
Compare two characters ignoring ASCII case.
Definition: character.hxx:340
SAL_CONSTEXPR bool isUnicodeScalarValue(sal_uInt32 code)
Check for Unicode scalar value.
Definition: character.hxx:485
SAL_CONSTEXPR bool isAsciiUpperCase(sal_uInt32 code)
Check for ASCII upper case character.
Definition: character.hxx:99
SAL_CONSTEXPR std::size_t splitSurrogates(sal_uInt32 code, sal_Unicode *output)
Split a Unicode code point into UTF-16 code units.
Definition: character.hxx:460
SAL_CONSTEXPR bool isSurrogate(sal_uInt32 code)
Check for surrogate.
Definition: character.hxx:366
SAL_CONSTEXPR bool isAsciiDigit(sal_uInt32 code)
Check for ASCII digit character.
Definition: character.hxx:147
SAL_CONSTEXPR sal_Unicode getLowSurrogate(sal_uInt32 code)
Get low surrogate half of a non-BMP Unicode code point.
Definition: character.hxx:423
SAL_CONSTEXPR bool isAsciiLowerCase(sal_uInt32 code)
Check for ASCII lower case character.
Definition: character.hxx:75
SAL_CONSTEXPR bool isAsciiCanonicHexDigit(sal_uInt32 code)
Check for ASCII canonic hexadecimal digit character.
Definition: character.hxx:195
SAL_CONSTEXPR sal_Unicode getHighSurrogate(sal_uInt32 code)
Get high surrogate half of a non-BMP Unicode code point.
Definition: character.hxx:408
SAL_CONSTEXPR sal_uInt32 combineSurrogates(sal_uInt32 high, sal_uInt32 low)
Combine surrogates to form a code point.
Definition: character.hxx:440
SAL_CONSTEXPR bool isLowSurrogate(sal_uInt32 code)
Check for low surrogate.
Definition: character.hxx:394
SAL_CONSTEXPR bool isAsciiOctalDigit(sal_uInt32 code)
Check for ASCII octal digit character.
Definition: character.hxx:242
SAL_CONSTEXPR bool isAsciiWhiteSpace(sal_uInt32 code)
Check for ASCII white space character.
Definition: character.hxx:266
SAL_CONSTEXPR sal_uInt32 toAsciiUpperCase(sal_uInt32 code)
Convert a character, if ASCII, to upper case.
Definition: character.hxx:290
SAL_CONSTEXPR bool isHighSurrogate(sal_uInt32 code)
Check for high surrogate.
Definition: character.hxx:380
SAL_CONSTEXPR bool isAsciiAlphanumeric(sal_uInt32 code)
Check for ASCII alphanumeric character.
Definition: character.hxx:171
SAL_CONSTEXPR sal_uInt32 toAsciiLowerCase(sal_uInt32 code)
Convert a character, if ASCII, to lower case.
Definition: character.hxx:313
sal_uInt16 sal_Unicode
Definition: types.h:123
SAL_CONSTEXPR bool isAsciiHexDigit(sal_uInt32 code)
Check for ASCII hexadecimal digit character.
Definition: character.hxx:219