LibreOffice Module i18npool (master) 1
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TextSearch Class Reference

#include <textsearch.hxx>

Inheritance diagram for TextSearch:
[legend]
Collaboration diagram for TextSearch:
[legend]

Public Member Functions

 TextSearch (const css::uno::Reference< css::uno::XComponentContext > &rxContext)
 
virtual ~TextSearch () override
 
virtual void SAL_CALL setOptions (const css::util::SearchOptions &options) override
 
virtual css::util::SearchResult SAL_CALL searchForward (const OUString &searchStr, sal_Int32 startPos, sal_Int32 endPos) override
 
virtual css::util::SearchResult SAL_CALL searchBackward (const OUString &searchStr, sal_Int32 startPos, sal_Int32 endPos) override
 
virtual void SAL_CALL setOptions2 (const css::util::SearchOptions2 &options) override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 

Private Types

typedef sal_Int32 startPos
 
typedef sal_Int32 sal_Int32 endPos
 

Private Member Functions

typedef css::util::SearchResult (SAL_CALL TextSearch::*FnSrch)(const OUString &searchStr
 
void MakeForwardTab ()
 
void MakeForwardTab2 ()
 
void MakeBackwardTab ()
 
void MakeBackwardTab2 ()
 
sal_Int32 GetDiff (const sal_Unicode) const
 
css::util::SearchResult SAL_CALL NSrchFrwrd (const OUString &searchStr, sal_Int32 startPos, sal_Int32 endPos)
 
css::util::SearchResult SAL_CALL NSrchBkwrd (const OUString &searchStr, sal_Int32 startPos, sal_Int32 endPos)
 
css::util::SearchResult SAL_CALL RESrchFrwrd (const OUString &searchStr, sal_Int32 startPos, sal_Int32 endPos)
 
css::util::SearchResult SAL_CALL RESrchBkwrd (const OUString &searchStr, sal_Int32 startPos, sal_Int32 endPos)
 
void RESrchPrepare (const css::util::SearchOptions2 &)
 
css::util::SearchResult SAL_CALL ApproxSrchFrwrd (const OUString &searchStr, sal_Int32 startPos, sal_Int32 endPos)
 
css::util::SearchResult SAL_CALL ApproxSrchBkwrd (const OUString &searchStr, sal_Int32 startPos, sal_Int32 endPos)
 
css::util::SearchResult SAL_CALL WildcardSrchFrwrd (const OUString &searchStr, sal_Int32 startPos, sal_Int32 endPos)
 
css::util::SearchResult SAL_CALL WildcardSrchBkwrd (const OUString &searchStr, sal_Int32 startPos, sal_Int32 endPos)
 
bool IsDelimiter (const OUString &rStr, sal_Int32 nPos) const
 

Private Attributes

std::mutex m_aMutex
 
css::uno::Reference< css::uno::XComponentContext > m_xContext
 
css::util::SearchOptions2 aSrchPara
 
OUString sSrchStr
 
OUString sSrchStr2
 
css::uno::Reference< css::i18n::XCharacterClassification > xCharClass
 
css::uno::Reference< css::i18n::XExtendedTransliteration > xTranslit
 
css::uno::Reference< css::i18n::XExtendedTransliteration > xTranslit2
 
FnSrch fnForward
 
FnSrch fnBackward
 
bool bSearchApostrophe
 
std::unique_ptr< TextSearchJumpTablepJumpTable
 
std::unique_ptr< TextSearchJumpTablepJumpTable2
 
bool bIsForwardTab
 
bool bUsePrimarySrchStr
 
std::unique_ptr< icu::RegexMatcher > pRegexMatcher
 
int nLimit
 
std::unique_ptr< WLevDistancepWLD
 
css::uno::Reference< css::i18n::XBreakIterator > xBreak
 
OUString maWildcardReversePattern
 
OUString maWildcardReversePattern2
 
sal_uInt32 mcWildcardEscapeChar
 
bool mbWildcardAllowSubstring
 

Detailed Description

Definition at line 44 of file textsearch.hxx.

Member Typedef Documentation

◆ endPos

typedef sal_Int32 sal_Int32 TextSearch::endPos
private

Definition at line 65 of file textsearch.hxx.

◆ startPos

typedef sal_Int32 TextSearch::startPos
private

Definition at line 65 of file textsearch.hxx.

Constructor & Destructor Documentation

◆ TextSearch()

TextSearch::TextSearch ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext)
explicit

◆ ~TextSearch()

TextSearch::~TextSearch ( )
overridevirtual

Definition at line 109 of file textsearch.cxx.

References pJumpTable, pJumpTable2, pRegexMatcher, and pWLD.

Member Function Documentation

◆ ApproxSrchBkwrd()

SearchResult TextSearch::ApproxSrchBkwrd ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 1093 of file textsearch.cxx.

References aSrchPara, nLimit, pWLD, and xBreak.

Referenced by setOptions2().

◆ ApproxSrchFrwrd()

SearchResult TextSearch::ApproxSrchFrwrd ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 1051 of file textsearch.cxx.

References aSrchPara, nLimit, pWLD, and xBreak.

Referenced by setOptions2().

◆ css::util::SearchResult()

typedef TextSearch::css::util::SearchResult ( SAL_CALL TextSearch::*  FnSrch) const &
private

◆ GetDiff()

sal_Int32 TextSearch::GetDiff ( const sal_Unicode  cChr) const
private

Definition at line 679 of file textsearch.cxx.

References bUsePrimarySrchStr, pJumpTable, pJumpTable2, sSrchStr, and sSrchStr2.

Referenced by NSrchBkwrd(), and NSrchFrwrd().

◆ getImplementationName()

OUString SAL_CALL TextSearch::getImplementationName ( )
overridevirtual

Definition at line 1544 of file textsearch.cxx.

◆ getSupportedServiceNames()

Sequence< OUString > SAL_CALL TextSearch::getSupportedServiceNames ( )
overridevirtual

Definition at line 1555 of file textsearch.cxx.

◆ IsDelimiter()

bool TextSearch::IsDelimiter ( const OUString &  rStr,
sal_Int32  nPos 
) const
private

Definition at line 563 of file textsearch.cxx.

References aSrchPara, DIGIT, m_xContext, nPos, and xCharClass.

Referenced by NSrchBkwrd(), and NSrchFrwrd().

◆ MakeBackwardTab()

void TextSearch::MakeBackwardTab ( )
private

Definition at line 633 of file textsearch.cxx.

References bIsForwardTab, n, pJumpTable, and sSrchStr.

Referenced by NSrchBkwrd().

◆ MakeBackwardTab2()

void TextSearch::MakeBackwardTab2 ( )
private

Definition at line 656 of file textsearch.cxx.

References bIsForwardTab, n, pJumpTable2, and sSrchStr2.

Referenced by NSrchBkwrd().

◆ MakeForwardTab()

void TextSearch::MakeForwardTab ( )
private

Definition at line 582 of file textsearch.cxx.

References bIsForwardTab, n, pJumpTable, and sSrchStr.

Referenced by NSrchFrwrd().

◆ MakeForwardTab2()

void TextSearch::MakeForwardTab2 ( )
private

Definition at line 608 of file textsearch.cxx.

References bIsForwardTab, n, pJumpTable2, and sSrchStr2.

Referenced by NSrchFrwrd().

◆ NSrchBkwrd()

SearchResult TextSearch::NSrchBkwrd ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 762 of file textsearch.cxx.

References aSrchPara, bUsePrimarySrchStr, GetDiff(), IsDelimiter(), MakeBackwardTab(), MakeBackwardTab2(), sSrchStr, and sSrchStr2.

Referenced by setOptions2().

◆ NSrchFrwrd()

SearchResult TextSearch::NSrchFrwrd ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 699 of file textsearch.cxx.

References aSrchPara, bUsePrimarySrchStr, GetDiff(), IsDelimiter(), MakeForwardTab(), MakeForwardTab2(), sSrchStr, and sSrchStr2.

Referenced by setOptions2().

◆ RESrchBkwrd()

SearchResult TextSearch::RESrchBkwrd ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 976 of file textsearch.cxx.

References i, lcl_findRegex(), and pRegexMatcher.

Referenced by setOptions2().

◆ RESrchFrwrd()

SearchResult TextSearch::RESrchFrwrd ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 922 of file textsearch.cxx.

References i, lcl_findRegex(), and pRegexMatcher.

Referenced by setOptions2().

◆ RESrchPrepare()

void TextSearch::RESrchPrepare ( const css::util::SearchOptions2 &  rOptions)
private

Definition at line 833 of file textsearch.cxx.

References pRegexMatcher, SAL_INFO, sSrchStr, and sSrchStr2.

Referenced by setOptions2().

◆ searchBackward()

SearchResult TextSearch::searchBackward ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
overridevirtual

◆ searchForward()

SearchResult TextSearch::searchForward ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
overridevirtual

◆ setOptions()

void TextSearch::setOptions ( const css::util::SearchOptions &  options)
overridevirtual

Definition at line 258 of file textsearch.cxx.

References SAL_WARN, and setOptions2().

◆ setOptions2()

void TextSearch::setOptions2 ( const css::util::SearchOptions2 &  options)
overridevirtual

◆ supportsService()

sal_Bool SAL_CALL TextSearch::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 1549 of file textsearch.cxx.

References cppu::supportsService().

◆ WildcardSrchBkwrd()

SearchResult TextSearch::WildcardSrchBkwrd ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 1313 of file textsearch.cxx.

References bUsePrimarySrchStr, i, maWildcardReversePattern, maWildcardReversePattern2, mbWildcardAllowSubstring, mcWildcardEscapeChar, nIndex, sSrchStr, and sSrchStr2.

Referenced by setOptions2().

◆ WildcardSrchFrwrd()

SearchResult TextSearch::WildcardSrchFrwrd ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 1142 of file textsearch.cxx.

References bUsePrimarySrchStr, i, mbWildcardAllowSubstring, mcWildcardEscapeChar, sSrchStr, and sSrchStr2.

Referenced by setOptions2().

Member Data Documentation

◆ aSrchPara

css::util::SearchOptions2 TextSearch::aSrchPara
private

◆ bIsForwardTab

bool TextSearch::bIsForwardTab
private

Definition at line 76 of file textsearch.hxx.

Referenced by MakeBackwardTab(), MakeBackwardTab2(), MakeForwardTab(), and MakeForwardTab2().

◆ bSearchApostrophe

bool TextSearch::bSearchApostrophe
private

Definition at line 71 of file textsearch.hxx.

Referenced by searchBackward(), searchForward(), and setOptions2().

◆ bUsePrimarySrchStr

bool TextSearch::bUsePrimarySrchStr
private

◆ fnBackward

FnSrch TextSearch::fnBackward
private

Definition at line 68 of file textsearch.hxx.

Referenced by searchBackward(), and setOptions2().

◆ fnForward

FnSrch TextSearch::fnForward
private

Definition at line 67 of file textsearch.hxx.

Referenced by searchForward(), and setOptions2().

◆ m_aMutex

std::mutex TextSearch::m_aMutex
private

Definition at line 50 of file textsearch.hxx.

Referenced by searchBackward(), searchForward(), and setOptions2().

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > TextSearch::m_xContext
private

Definition at line 51 of file textsearch.hxx.

Referenced by IsDelimiter(), and setOptions2().

◆ maWildcardReversePattern

OUString TextSearch::maWildcardReversePattern
private

Definition at line 118 of file textsearch.hxx.

Referenced by setOptions2(), and WildcardSrchBkwrd().

◆ maWildcardReversePattern2

OUString TextSearch::maWildcardReversePattern2
private

Definition at line 119 of file textsearch.hxx.

Referenced by setOptions2(), and WildcardSrchBkwrd().

◆ mbWildcardAllowSubstring

bool TextSearch::mbWildcardAllowSubstring
private

Definition at line 121 of file textsearch.hxx.

Referenced by setOptions2(), WildcardSrchBkwrd(), and WildcardSrchFrwrd().

◆ mcWildcardEscapeChar

sal_uInt32 TextSearch::mcWildcardEscapeChar
private

Definition at line 120 of file textsearch.hxx.

Referenced by setOptions2(), WildcardSrchBkwrd(), and WildcardSrchFrwrd().

◆ nLimit

int TextSearch::nLimit
private

Definition at line 105 of file textsearch.hxx.

Referenced by ApproxSrchBkwrd(), ApproxSrchFrwrd(), and setOptions2().

◆ pJumpTable

std::unique_ptr<TextSearchJumpTable> TextSearch::pJumpTable
private

Definition at line 74 of file textsearch.hxx.

Referenced by GetDiff(), MakeBackwardTab(), MakeForwardTab(), setOptions2(), and ~TextSearch().

◆ pJumpTable2

std::unique_ptr<TextSearchJumpTable> TextSearch::pJumpTable2
private

Definition at line 75 of file textsearch.hxx.

Referenced by GetDiff(), MakeBackwardTab2(), MakeForwardTab2(), setOptions2(), and ~TextSearch().

◆ pRegexMatcher

std::unique_ptr<icu::RegexMatcher> TextSearch::pRegexMatcher
private

◆ pWLD

std::unique_ptr<WLevDistance> TextSearch::pWLD
private

Definition at line 106 of file textsearch.hxx.

Referenced by ApproxSrchBkwrd(), ApproxSrchFrwrd(), setOptions2(), and ~TextSearch().

◆ sSrchStr

OUString TextSearch::sSrchStr
private

◆ sSrchStr2

OUString TextSearch::sSrchStr2
private

◆ xBreak

css::uno::Reference< css::i18n::XBreakIterator > TextSearch::xBreak
private

Definition at line 107 of file textsearch.hxx.

Referenced by ApproxSrchBkwrd(), ApproxSrchFrwrd(), and setOptions2().

◆ xCharClass

css::uno::Reference< css::i18n::XCharacterClassification > TextSearch::xCharClass
mutableprivate

Definition at line 57 of file textsearch.hxx.

Referenced by IsDelimiter().

◆ xTranslit

css::uno::Reference< css::i18n::XExtendedTransliteration > TextSearch::xTranslit
private

Definition at line 59 of file textsearch.hxx.

Referenced by searchBackward(), searchForward(), and setOptions2().

◆ xTranslit2

css::uno::Reference< css::i18n::XExtendedTransliteration > TextSearch::xTranslit2
private

Definition at line 60 of file textsearch.hxx.

Referenced by searchBackward(), searchForward(), and setOptions2().


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