LibreOffice Module unotools (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CharClass Class Reference

#include <charclass.hxx>

Collaboration diagram for CharClass:
[legend]

Public Member Functions

 CharClass (const css::uno::Reference< css::uno::XComponentContext > &rxContext, LanguageTag aLanguageTag)
 Preferred ctor with service manager specified. More...
 
 CharClass (LanguageTag aLanguageTag)
 Deprecated ctor, tries to get a process service manager or to load the library directly. More...
 
 ~CharClass ()
 
const LanguageTaggetLanguageTag () const
 get current Locale More...
 
OUString uppercase (const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
 
OUString lowercase (const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
 
OUString titlecase (const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
 
OUString uppercase (const OUString &_rStr) const
 
OUString lowercase (const OUString &_rStr) const
 
OUString titlecase (const OUString &_rStr) const
 
sal_Int16 getType (const OUString &rStr, sal_Int32 nPos) const
 
css::i18n::DirectionProperty getCharacterDirection (const OUString &rStr, sal_Int32 nPos) const
 
css::i18n::UnicodeScript getScript (const OUString &rStr, sal_Int32 nPos) const
 
sal_Int32 getCharacterType (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
 
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
 
bool isAlpha (const OUString &rStr, sal_Int32 nPos) const
 
bool isLetter (const OUString &rStr, sal_Int32 nPos) const
 
bool isDigit (const OUString &rStr, sal_Int32 nPos) const
 
bool isAlphaNumeric (const OUString &rStr, sal_Int32 nPos) const
 
bool isLetterNumeric (const OUString &rStr, sal_Int32 nPos) const
 
bool isBase (const OUString &rStr, sal_Int32 nPos) const
 
bool isUpper (const OUString &rStr, sal_Int32 nPos) const
 
bool isLetter (const OUString &rStr) const
 
bool isNumeric (const OUString &rStr) const
 
bool isLetterNumeric (const OUString &rStr) const
 
bool isUpper (const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
 

Static Public Member Functions

static bool isAsciiNumeric (std::u16string_view rStr)
 isdigit() on ascii values of entire string More...
 
static bool isAsciiAlpha (std::u16string_view rStr)
 isalpha() on ascii values of entire string More...
 
static bool isNumericType (sal_Int32 nType)
 whether type is pure numeric or not, e.g. return of getCharacterType() More...
 
static bool isAlphaNumericType (sal_Int32 nType)
 whether type is pure alphanumeric or not, e.g. return of getCharacterType() More...
 
static bool isLetterType (sal_Int32 nType)
 whether type is pure letter or not, e.g. return of getCharacterType() More...
 
static bool isLetterNumericType (sal_Int32 nType)
 whether type is pure letternumeric or not, e.g. return of getCharacterType() More...
 

Private Member Functions

 CharClass (const CharClass &)=delete
 
CharClassoperator= (const CharClass &)=delete
 
const css::lang::Locale & getMyLocale () const
 

Private Attributes

LanguageTag maLanguageTag
 
css::uno::Reference< css::i18n::XCharacterClassification > xCC
 

Detailed Description

Definition at line 64 of file charclass.hxx.

Constructor & Destructor Documentation

◆ CharClass() [1/3]

CharClass::CharClass ( const CharClass )
privatedelete

◆ CharClass() [2/3]

CharClass::CharClass ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
LanguageTag  aLanguageTag 
)

Preferred ctor with service manager specified.

References getLanguageTag().

◆ CharClass() [3/3]

CharClass::CharClass ( LanguageTag  aLanguageTag)

Deprecated ctor, tries to get a process service manager or to load the library directly.

Definition at line 41 of file charclass.cxx.

References comphelper::getProcessComponentContext(), maLanguageTag, and xCC.

◆ ~CharClass()

CharClass::~CharClass ( )

Definition at line 47 of file charclass.cxx.

Member Function Documentation

◆ getCharacterDirection()

css::i18n::DirectionProperty CharClass::getCharacterDirection ( const OUString &  rStr,
sal_Int32  nPos 
) const

Definition at line 370 of file charclass.cxx.

References Exception, nPos, TOOLS_WARN_EXCEPTION, and xCC.

◆ getCharacterType()

sal_Int32 CharClass::getCharacterType ( const OUString &  rStr,
sal_Int32  nPos 
) const

Definition at line 396 of file charclass.cxx.

References Exception, getMyLocale(), nPos, TOOLS_WARN_EXCEPTION, and xCC.

◆ getLanguageTag()

const LanguageTag & CharClass::getLanguageTag ( ) const

get current Locale

Definition at line 51 of file charclass.cxx.

References maLanguageTag.

Referenced by utl::TextSearch::TextSearch().

◆ getMyLocale()

const css::lang::Locale & CharClass::getMyLocale ( ) const
private

◆ getScript()

css::i18n::UnicodeScript CharClass::getScript ( const OUString &  rStr,
sal_Int32  nPos 
) const

Definition at line 383 of file charclass.cxx.

References Exception, nPos, TOOLS_WARN_EXCEPTION, and xCC.

◆ getType()

sal_Int16 CharClass::getType ( const OUString &  rStr,
sal_Int32  nPos 
) const

Definition at line 357 of file charclass.cxx.

References Exception, nPos, TOOLS_WARN_EXCEPTION, and xCC.

◆ isAlpha()

bool CharClass::isAlpha ( const OUString &  rStr,
sal_Int32  nPos 
) const

Definition at line 97 of file charclass.cxx.

References Exception, getMyLocale(), nCharClassAlphaType, nPos, TOOLS_WARN_EXCEPTION, and xCC.

◆ isAlphaNumeric()

bool CharClass::isAlphaNumeric ( const OUString &  rStr,
sal_Int32  nPos 
) const

◆ isAlphaNumericType()

static bool CharClass::isAlphaNumericType ( sal_Int32  nType)
inlinestatic

whether type is pure alphanumeric or not, e.g. return of getCharacterType()

Definition at line 101 of file charclass.hxx.

References nCharClassAlphaType, nCharClassAlphaTypeMask, nCharClassNumericType, nCharClassNumericTypeMask, and nType.

◆ isAsciiAlpha()

bool CharClass::isAsciiAlpha ( std::u16string_view  rStr)
static

isalpha() on ascii values of entire string

Definition at line 80 of file charclass.cxx.

References p.

◆ isAsciiNumeric()

bool CharClass::isAsciiNumeric ( std::u16string_view  rStr)
static

isdigit() on ascii values of entire string

Definition at line 62 of file charclass.cxx.

References p.

◆ isBase()

bool CharClass::isBase ( const OUString &  rStr,
sal_Int32  nPos 
) const

Definition at line 256 of file charclass.cxx.

References Exception, getMyLocale(), nCharClassBaseType, nPos, TOOLS_WARN_EXCEPTION, and xCC.

◆ isDigit()

bool CharClass::isDigit ( const OUString &  rStr,
sal_Int32  nPos 
) const

Definition at line 156 of file charclass.cxx.

References Exception, getMyLocale(), nPos, TOOLS_WARN_EXCEPTION, and xCC.

Referenced by isNumeric().

◆ isLetter() [1/2]

bool CharClass::isLetter ( const OUString &  rStr) const

Definition at line 133 of file charclass.cxx.

References Exception, isLetter(), nPos, and TOOLS_WARN_EXCEPTION.

◆ isLetter() [2/2]

bool CharClass::isLetter ( const OUString &  rStr,
sal_Int32  nPos 
) const

Definition at line 115 of file charclass.cxx.

References Exception, getMyLocale(), nCharClassLetterType, nPos, TOOLS_WARN_EXCEPTION, and xCC.

Referenced by isLetter().

◆ isLetterNumeric() [1/2]

bool CharClass::isLetterNumeric ( const OUString &  rStr) const

Definition at line 233 of file charclass.cxx.

References Exception, isLetterNumeric(), nPos, and TOOLS_WARN_EXCEPTION.

◆ isLetterNumeric() [2/2]

bool CharClass::isLetterNumeric ( const OUString &  rStr,
sal_Int32  nPos 
) const

◆ isLetterNumericType()

static bool CharClass::isLetterNumericType ( sal_Int32  nType)
inlinestatic

whether type is pure letternumeric or not, e.g. return of getCharacterType()

Definition at line 117 of file charclass.hxx.

References nCharClassLetterType, nCharClassLetterTypeMask, nCharClassNumericType, nCharClassNumericTypeMask, and nType.

◆ isLetterType()

static bool CharClass::isLetterType ( sal_Int32  nType)
inlinestatic

whether type is pure letter or not, e.g. return of getCharacterType()

Definition at line 110 of file charclass.hxx.

References nCharClassLetterType, and nType.

◆ isNumeric()

bool CharClass::isNumeric ( const OUString &  rStr) const

Definition at line 174 of file charclass.cxx.

References Exception, isDigit(), nPos, and TOOLS_WARN_EXCEPTION.

◆ isNumericType()

static bool CharClass::isNumericType ( sal_Int32  nType)
inlinestatic

whether type is pure numeric or not, e.g. return of getCharacterType()

Definition at line 94 of file charclass.hxx.

References nCharClassNumericType, and nType.

◆ isUpper() [1/2]

bool CharClass::isUpper ( const OUString &  rStr,
sal_Int32  nPos 
) const

Definition at line 273 of file charclass.cxx.

References Exception, getMyLocale(), nPos, TOOLS_WARN_EXCEPTION, and xCC.

Referenced by isUpper().

◆ isUpper() [2/2]

bool CharClass::isUpper ( const OUString &  rStr,
sal_Int32  nPos,
sal_Int32  nCount 
) const

Definition at line 291 of file charclass.cxx.

References Exception, isUpper(), nCount, nPos, and TOOLS_WARN_EXCEPTION.

◆ lowercase() [1/2]

OUString CharClass::lowercase ( const OUString &  _rStr) const
inline

Definition at line 135 of file charclass.hxx.

◆ lowercase() [2/2]

OUString CharClass::lowercase ( const OUString &  rStr,
sal_Int32  nPos,
sal_Int32  nCount 
) const

Definition at line 344 of file charclass.cxx.

References Exception, getMyLocale(), nCount, nPos, TOOLS_WARN_EXCEPTION, and xCC.

◆ operator=()

CharClass & CharClass::operator= ( const CharClass )
privatedelete

◆ parseAnyToken()

css::i18n::ParseResult CharClass::parseAnyToken ( const OUString &  rStr,
sal_Int32  nPos,
sal_Int32  nStartCharFlags,
const OUString &  userDefinedCharactersStart,
sal_Int32  nContCharFlags,
const OUString &  userDefinedCharactersCont 
) const

Definition at line 409 of file charclass.cxx.

References Exception, getMyLocale(), nPos, TOOLS_WARN_EXCEPTION, and xCC.

◆ parsePredefinedToken()

css::i18n::ParseResult CharClass::parsePredefinedToken ( sal_Int32  nTokenType,
const OUString &  rStr,
sal_Int32  nPos,
sal_Int32  nStartCharFlags,
const OUString &  userDefinedCharactersStart,
sal_Int32  nContCharFlags,
const OUString &  userDefinedCharactersCont 
) const

Definition at line 430 of file charclass.cxx.

References Exception, getMyLocale(), nPos, TOOLS_WARN_EXCEPTION, and xCC.

◆ titlecase() [1/2]

OUString CharClass::titlecase ( const OUString &  _rStr) const
inline

Definition at line 139 of file charclass.hxx.

◆ titlecase() [2/2]

OUString CharClass::titlecase ( const OUString &  rStr,
sal_Int32  nPos,
sal_Int32  nCount 
) const

Definition at line 318 of file charclass.cxx.

References Exception, getMyLocale(), nCount, nPos, TOOLS_WARN_EXCEPTION, and xCC.

◆ uppercase() [1/2]

OUString CharClass::uppercase ( const OUString &  _rStr) const
inline

Definition at line 131 of file charclass.hxx.

◆ uppercase() [2/2]

OUString CharClass::uppercase ( const OUString &  rStr,
sal_Int32  nPos,
sal_Int32  nCount 
) const

Definition at line 331 of file charclass.cxx.

References Exception, getMyLocale(), nCount, nPos, TOOLS_WARN_EXCEPTION, and xCC.

Member Data Documentation

◆ maLanguageTag

LanguageTag CharClass::maLanguageTag
private

Definition at line 66 of file charclass.hxx.

Referenced by getLanguageTag(), and getMyLocale().

◆ xCC

css::uno::Reference< css::i18n::XCharacterClassification > CharClass::xCC
private

The documentation for this class was generated from the following files: