20 #ifndef INCLUDED_RTL_CHARACTER_HXX 21 #define INCLUDED_RTL_CHARACTER_HXX 43 return code <= 0x10FFFF;
60 #if defined LIBO_INTERNAL_ONLY 62 bool isAscii(
signed char) =
delete;
63 template<
typename T>
inline bool isAscii(T code)
64 {
return isAscii(sal_uInt32(code)); }
79 return code >=
'a' && code <=
'z';
82 #if defined LIBO_INTERNAL_ONLY 101 return code >=
'A' && code <=
'Z';
104 #if defined LIBO_INTERNAL_ONLY 126 #if defined LIBO_INTERNAL_ONLY 145 return code >=
'0' && code <=
'9';
148 #if defined LIBO_INTERNAL_ONLY 170 #if defined LIBO_INTERNAL_ONLY 189 return isAsciiDigit(code) || (code >=
'A' && code <=
'F');
192 #if defined LIBO_INTERNAL_ONLY 214 #if defined LIBO_INTERNAL_ONLY 232 return code >=
'0' && code <=
'7';
235 #if defined LIBO_INTERNAL_ONLY 254 return code ==
' ' || code ==
'\f' || code ==
'\n' || code ==
'\r' 255 || code ==
'\t' || code ==
'\v';
258 #if defined LIBO_INTERNAL_ONLY 279 #if defined LIBO_INTERNAL_ONLY 300 #if defined LIBO_INTERNAL_ONLY 330 sal_uInt32
const surrogatesHighFirst = 0xD800;
331 sal_uInt32
const surrogatesHighLast = 0xDBFF;
332 sal_uInt32
const surrogatesLowFirst = 0xDC00;
333 sal_uInt32
const surrogatesLowLast = 0xDFFF;
348 return code >= detail::surrogatesHighFirst
349 && code <= detail::surrogatesLowLast;
362 return code >= detail::surrogatesHighFirst
363 && code <= detail::surrogatesHighLast;
376 return code >= detail::surrogatesLowFirst
377 && code <= detail::surrogatesLowLast;
390 assert(code >= 0x10000);
391 return static_cast<sal_Unicode>(((code - 0x10000) >> 10) | detail::surrogatesHighFirst);
404 assert(code >= 0x10000);
405 return static_cast<sal_Unicode>(((code - 0x10000) & 0x3FF) | detail::surrogatesLowFirst);
421 return ((high - detail::surrogatesHighFirst) << 10)
422 + (low - detail::surrogatesLowFirst) + 0x10000;
439 assert(output != NULL);
440 if (code < 0x10000) {
bool isLowSurrogate(sal_uInt32 code)
Check for low surrogate.
Definition: character.hxx:374
bool isAsciiDigit(sal_uInt32 code)
Check for ASCII digit character.
Definition: character.hxx:142
bool isHighSurrogate(sal_uInt32 code)
Check for high surrogate.
Definition: character.hxx:360
sal_Int32 compareIgnoreAsciiCase(sal_uInt32 code1, sal_uInt32 code2)
Compare two characters ignoring ASCII case.
Definition: character.hxx:319
sal_uInt32 toAsciiLowerCase(sal_uInt32 code)
Convert a character, if ASCII, to lower case.
Definition: character.hxx:294
sal_uInt32 toAsciiUpperCase(sal_uInt32 code)
Convert a character, if ASCII, to upper case.
Definition: character.hxx:273
bool isUnicodeCodePoint(sal_uInt32 code)
Check for Unicode code point.
Definition: character.hxx:41
sal_Unicode getLowSurrogate(sal_uInt32 code)
Get low surrogate half of a non-BMP Unicode code point.
Definition: character.hxx:402
bool isAsciiWhiteSpace(sal_uInt32 code)
Check for ASCII white space character.
Definition: character.hxx:251
bool isUnicodeScalarValue(sal_uInt32 code)
Check for Unicode scalar value.
Definition: character.hxx:458
bool isAsciiAlpha(sal_uInt32 code)
Check for ASCII alphabetic character.
Definition: character.hxx:120
bool isAsciiOctalDigit(sal_uInt32 code)
Check for ASCII octal digit character.
Definition: character.hxx:229
bool isSurrogate(sal_uInt32 code)
Check for surrogate.
Definition: character.hxx:346
bool isAsciiHexDigit(sal_uInt32 code)
Check for ASCII hexadecimal digit character.
Definition: character.hxx:208
sal_uInt16 sal_Unicode
Definition: types.h:141
std::size_t splitSurrogates(sal_uInt32 code, sal_Unicode *output)
Split a Unicode code point into UTF-16 code units.
Definition: character.hxx:437
Definition: bootstrap.hxx:29
bool isAsciiAlphanumeric(sal_uInt32 code)
Check for ASCII alphanumeric character.
Definition: character.hxx:164
sal_uInt32 combineSurrogates(sal_uInt32 high, sal_uInt32 low)
Combine surrogates to form a code point.
Definition: character.hxx:418
bool isAsciiCanonicHexDigit(sal_uInt32 code)
Check for ASCII canonic hexadecimal digit character.
Definition: character.hxx:186
bool isAscii(sal_uInt32 code)
Check for ASCII character.
Definition: character.hxx:54
bool isAsciiUpperCase(sal_uInt32 code)
Check for ASCII upper case character.
Definition: character.hxx:98
sal_Unicode getHighSurrogate(sal_uInt32 code)
Get high surrogate half of a non-BMP Unicode code point.
Definition: character.hxx:388
bool isAsciiLowerCase(sal_uInt32 code)
Check for ASCII lower case character.
Definition: character.hxx:76