20#ifndef INCLUDED_UNOTOOLS_CHARCLASS_HXX
21#define INCLUDED_UNOTOOLS_CHARCLASS_HXX
25#include <com/sun/star/i18n/DirectionProperty.hpp>
26#include <com/sun/star/i18n/KCharacterType.hpp>
27#include <com/sun/star/i18n/ParseResult.hpp>
28#include <com/sun/star/i18n/UnicodeScript.hpp>
29#include <com/sun/star/uno/Reference.hxx>
35 css::i18n::KCharacterType::UPPER |
36 css::i18n::KCharacterType::LOWER |
37 css::i18n::KCharacterType::TITLE_CASE;
41 css::i18n::KCharacterType::LETTER |
42 css::i18n::KCharacterType::PRINTABLE |
43 css::i18n::KCharacterType::BASE_FORM;
47 css::i18n::KCharacterType::LETTER;
51 css::i18n::KCharacterType::LETTER;
54 css::i18n::KCharacterType::DIGIT;
58 css::i18n::KCharacterType::PRINTABLE |
59 css::i18n::KCharacterType::BASE_FORM;
62 css::i18n::KCharacterType::BASE_FORM;
67 css::uno::Reference< css::i18n::XCharacterClassification >
xCC;
75 const css::uno::Reference< css::uno::XComponentContext > & rxContext,
88 static bool isAsciiNumeric( std::u16string_view rStr );
91 static bool isAsciiAlpha( std::u16string_view rStr );
97 ((
nType & ~nCharClassNumericTypeMask) == 0);
113 ((
nType & ~nCharClassLetterTypeMask) == 0);
127 OUString uppercase(
const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount )
const;
128 OUString lowercase(
const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount )
const;
129 OUString titlecase(
const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount )
const;
133 return uppercase(_rStr, 0, _rStr.getLength());
137 return lowercase(_rStr, 0, _rStr.getLength());
141 return titlecase(_rStr, 0, _rStr.getLength());
144 sal_Int16
getType(
const OUString& rStr, sal_Int32 nPos )
const;
145 css::i18n::DirectionProperty getCharacterDirection(
const OUString& rStr, sal_Int32 nPos )
const;
146 css::i18n::UnicodeScript getScript(
const OUString& rStr, sal_Int32 nPos )
const;
147 sal_Int32 getCharacterType(
const OUString& rStr, sal_Int32 nPos )
const;
149 css::i18n::ParseResult parseAnyToken(
150 const OUString& rStr,
152 sal_Int32 nStartCharFlags,
153 const OUString& userDefinedCharactersStart,
154 sal_Int32 nContCharFlags,
155 const OUString& userDefinedCharactersCont )
const;
157 css::i18n::ParseResult parsePredefinedToken(
158 sal_Int32 nTokenType,
159 const OUString& rStr,
161 sal_Int32 nStartCharFlags,
162 const OUString& userDefinedCharactersStart,
163 sal_Int32 nContCharFlags,
164 const OUString& userDefinedCharactersCont )
const;
168 bool isAlpha(
const OUString& rStr, sal_Int32 nPos )
const;
169 bool isLetter(
const OUString& rStr, sal_Int32 nPos )
const;
170 bool isDigit(
const OUString& rStr, sal_Int32 nPos )
const;
171 bool isAlphaNumeric(
const OUString& rStr, sal_Int32 nPos )
const;
172 bool isLetterNumeric(
const OUString& rStr, sal_Int32 nPos )
const;
173 bool isBase(
const OUString& rStr, sal_Int32 nPos )
const;
174 bool isUpper(
const OUString& rStr, sal_Int32 nPos )
const;
175 bool isLetter(
const OUString& rStr )
const;
176 bool isNumeric(
const OUString& rStr )
const;
177 bool isLetterNumeric(
const OUString& rStr )
const;
179 bool isUpper(
const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount )
const;
183 const css::lang::Locale & getMyLocale()
const;
constexpr sal_Int32 nCharClassBaseType
constexpr sal_Int32 nCharClassNumericType
constexpr sal_Int32 nCharClassAlphaType
constexpr sal_Int32 nCharClassLetterType
constexpr sal_Int32 nCharClassAlphaTypeMask
constexpr sal_Int32 nCharClassLetterTypeMask
constexpr sal_Int32 nCharClassNumericTypeMask
CharClass(const css::uno::Reference< css::uno::XComponentContext > &rxContext, LanguageTag aLanguageTag)
Preferred ctor with service manager specified.
static bool isLetterNumericType(sal_Int32 nType)
whether type is pure letternumeric or not, e.g. return of getCharacterType()
OUString titlecase(const OUString &_rStr) const
OUString lowercase(const OUString &_rStr) const
static bool isAlphaNumericType(sal_Int32 nType)
whether type is pure alphanumeric or not, e.g. return of getCharacterType()
static bool isLetterType(sal_Int32 nType)
whether type is pure letter or not, e.g. return of getCharacterType()
CharClass & operator=(const CharClass &)=delete
css::uno::Reference< css::i18n::XCharacterClassification > xCC
OUString uppercase(const OUString &_rStr) const
static bool isNumericType(sal_Int32 nType)
whether type is pure numeric or not, e.g. return of getCharacterType()
LanguageTag maLanguageTag
CharClass(const CharClass &)=delete
bool isAlpha(sal_Unicode c, bool bCompatible)
bool isLetter(sal_Unicode c)
bool isAlphaNumeric(sal_Unicode c, bool bCompatible)
const LanguageTag & getLanguageTag()
bool getType(BSTR name, Type &type)