22#include <rtl/character.hxx>
25#include <com/sun/star/i18n/CharacterClassification.hpp>
33 const Reference< uno::XComponentContext > & rxContext,
38 xCC = CharacterClassification::create( rxContext );
71 if ( !rtl::isAsciiDigit( *
p ) )
74 while ( ++
p < pStop );
89 if ( !rtl::isAsciiAlpha( *
p ) )
92 while ( ++
p < pStop );
101 return rtl::isAsciiAlpha( c );
119 return rtl::isAsciiAlpha( c );
141 while (
nPos < rStr.getLength())
145 rStr.iterateCodePoints( &
nPos);
160 return rtl::isAsciiDigit( c );
165 KCharacterType::DIGIT) != 0;
182 while (
nPos < rStr.getLength())
186 rStr.iterateCodePoints( &
nPos);
201 return rtl::isAsciiAlphanumeric( c );
219 return rtl::isAsciiAlphanumeric( c );
241 while (
nPos < rStr.getLength())
245 rStr.iterateCodePoints( &
nPos);
260 return rtl::isAsciiAlphanumeric( c );
277 return rtl::isAsciiUpperCase(c);
282 KCharacterType::UPPER) != 0;
297 if (nPos < 0 || nPos >= rStr.getLength() ||
nCount == 0)
302 const sal_Int32 nLen = std::min(
nPos +
nCount, rStr.getLength());
307 rStr.iterateCodePoints( &
nPos);
361 return xCC->getType( rStr,
nPos );
374 return static_cast<css::i18n::DirectionProperty
>(
xCC->getCharacterDirection( rStr,
nPos ));
380 return css::i18n::DirectionProperty_LEFT_TO_RIGHT;
387 return static_cast<css::i18n::UnicodeScript
>(
xCC->getScript( rStr,
nPos ));
393 return UnicodeScript_kBasicLatin;
410 const OUString& rStr,
412 sal_Int32 nStartCharFlags,
413 const OUString& userDefinedCharactersStart,
414 sal_Int32 nContCharFlags,
415 const OUString& userDefinedCharactersCont )
const
420 nStartCharFlags, userDefinedCharactersStart,
421 nContCharFlags, userDefinedCharactersCont );
427 return ParseResult();
431 sal_Int32 nTokenType,
432 const OUString& rStr,
434 sal_Int32 nStartCharFlags,
435 const OUString& userDefinedCharactersStart,
436 sal_Int32 nContCharFlags,
437 const OUString& userDefinedCharactersCont )
const
442 nStartCharFlags, userDefinedCharactersStart,
443 nContCharFlags, userDefinedCharactersCont );
449 return ParseResult();
constexpr sal_Int32 nCharClassBaseType
constexpr sal_Int32 nCharClassNumericType
constexpr sal_Int32 nCharClassAlphaType
constexpr sal_Int32 nCharClassLetterType
bool isNumeric(const OUString &rStr) const
static bool isAsciiNumeric(std::u16string_view rStr)
isdigit() on ascii values of entire string
static bool isAsciiAlpha(std::u16string_view rStr)
isalpha() on ascii values of entire string
OUString titlecase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
css::i18n::DirectionProperty getCharacterDirection(const OUString &rStr, sal_Int32 nPos) const
sal_Int32 getCharacterType(const OUString &rStr, sal_Int32 nPos) const
bool isAlpha(const OUString &rStr, sal_Int32 nPos) const
css::i18n::ParseResult parseAnyToken(const OUString &rStr, sal_Int32 nPos, sal_Int32 nStartCharFlags, const OUString &userDefinedCharactersStart, sal_Int32 nContCharFlags, const OUString &userDefinedCharactersCont) const
OUString lowercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
const css::lang::Locale & getMyLocale() const
const LanguageTag & getLanguageTag() const
get current Locale
bool isAlphaNumeric(const OUString &rStr, sal_Int32 nPos) const
bool isUpper(const OUString &rStr, sal_Int32 nPos) const
bool isLetter(const OUString &rStr, sal_Int32 nPos) const
css::uno::Reference< css::i18n::XCharacterClassification > xCC
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
bool isBase(const OUString &rStr, sal_Int32 nPos) const
css::i18n::ParseResult parsePredefinedToken(sal_Int32 nTokenType, const OUString &rStr, sal_Int32 nPos, sal_Int32 nStartCharFlags, const OUString &userDefinedCharactersStart, sal_Int32 nContCharFlags, const OUString &userDefinedCharactersCont) const
sal_Int16 getType(const OUString &rStr, sal_Int32 nPos) const
LanguageTag maLanguageTag
CharClass(const CharClass &)=delete
css::i18n::UnicodeScript getScript(const OUString &rStr, sal_Int32 nPos) const
bool isDigit(const OUString &rStr, sal_Int32 nPos) const
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
#define TOOLS_WARN_EXCEPTION(area, stream)
LanguageTag maLanguageTag
Reference< XComponentContext > getProcessComponentContext()