inline constexpr sal_Int32 nCharClassAlphaTypeMask =
nCharClassAlphaType |
css::i18n::KCharacterType::LETTER | // Alpha is also always a LETTER
css::i18n::KCharacterType::PRINTABLE |
css::i18n::KCharacterType::BASE_FORM;
public: /// Preferred ctor with service manager specified
CharClass( const css::uno::Reference< css::uno::XComponentContext > & rxContext,
LanguageTag aLanguageTag );
/// Deprecated ctor, tries to get a process service manager or to load the /// library directly.
CharClass( LanguageTag aLanguageTag );
~CharClass();
/// get current Locale const LanguageTag& getLanguageTag() const;
/// isdigit() on ascii values of entire string staticbool isAsciiNumeric( std::u16string_view rStr );
/// isalpha() on ascii values of entire string staticbool isAsciiAlpha( std::u16string_view rStr );
/// whether type is pure numeric or not, e.g. return of getCharacterType() staticbool isNumericType( sal_Int32 nType )
{ return ((nType & nCharClassNumericType) != 0) &&
((nType & ~nCharClassNumericTypeMask) == 0);
}
/// whether type is pure alphanumeric or not, e.g. return of getCharacterType() staticbool isAlphaNumericType( sal_Int32 nType )
{ return ((nType & (nCharClassAlphaType |
nCharClassNumericType)) != 0) &&
((nType & ~(nCharClassAlphaTypeMask |
nCharClassNumericTypeMask)) == 0);
}
/// whether type is pure letter or not, e.g. return of getCharacterType() staticbool isLetterType( sal_Int32 nType )
{ return ((nType & nCharClassLetterType) != 0) &&
((nType & ~nCharClassLetterTypeMask) == 0);
}
/// whether type is pure letternumeric or not, e.g. return of getCharacterType() staticbool isLetterNumericType( sal_Int32 nType )
{ return ((nType & (nCharClassLetterType |
nCharClassNumericType)) != 0) &&
((nType & ~(nCharClassLetterTypeMask |
nCharClassNumericTypeMask)) == 0);
}
// Wrapper implementations of class CharacterClassification
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.