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
 
bool isCellStart (const OUString &searchStr, sal_Int32 nPos)
 

Private Attributes

osl::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
 
bool checkCTLStart
 
bool checkCTLEnd
 

Detailed Description

Definition at line 45 of file textsearch.hxx.

Member Typedef Documentation

typedef sal_Int32 sal_Int32 TextSearch::endPos
private

Definition at line 66 of file textsearch.hxx.

typedef sal_Int32 TextSearch::startPos
private

Definition at line 66 of file textsearch.hxx.

Constructor & Destructor Documentation

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

Definition at line 109 of file textsearch.cxx.

References pJumpTable, pJumpTable2, pRegexMatcher, and pWLD.

Member Function Documentation

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

Definition at line 1116 of file textsearch.cxx.

References aSrchPara, nLimit, pWLD, and xBreak.

Referenced by setOptions2().

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

Definition at line 1072 of file textsearch.cxx.

References aSrchPara, nLimit, pWLD, and xBreak.

Referenced by setOptions2().

typedef TextSearch::css::util::SearchResult ( SAL_CALL TextSearch::*  FnSrch) const
private
sal_Int32 TextSearch::GetDiff ( const sal_Unicode  cChr) const
private

Definition at line 687 of file textsearch.cxx.

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

Referenced by NSrchBkwrd(), and NSrchFrwrd().

OUString SAL_CALL TextSearch::getImplementationName ( )
overridevirtual

Definition at line 1571 of file textsearch.cxx.

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

Definition at line 1582 of file textsearch.cxx.

bool TextSearch::isCellStart ( const OUString &  searchStr,
sal_Int32  nPos 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 310 of file textsearch.cxx.

References aSrchPara, and xBreak.

Referenced by NSrchBkwrd(), and NSrchFrwrd().

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

Definition at line 571 of file textsearch.cxx.

References aSrchPara, DIGIT, m_xContext, and xCharClass.

Referenced by NSrchBkwrd(), and NSrchFrwrd().

void TextSearch::MakeBackwardTab ( )
private

Definition at line 641 of file textsearch.cxx.

References bIsForwardTab, n, pJumpTable, and sSrchStr.

Referenced by NSrchBkwrd().

void TextSearch::MakeBackwardTab2 ( )
private

Definition at line 664 of file textsearch.cxx.

References bIsForwardTab, n, pJumpTable2, and sSrchStr2.

Referenced by NSrchBkwrd().

void TextSearch::MakeForwardTab ( )
private

Definition at line 590 of file textsearch.cxx.

References bIsForwardTab, n, pJumpTable, and sSrchStr.

Referenced by NSrchFrwrd().

void TextSearch::MakeForwardTab2 ( )
private

Definition at line 616 of file textsearch.cxx.

References bIsForwardTab, n, pJumpTable2, and sSrchStr2.

Referenced by NSrchFrwrd().

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

Definition at line 777 of file textsearch.cxx.

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

Referenced by setOptions2().

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

Definition at line 707 of file textsearch.cxx.

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

Referenced by setOptions2().

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

Definition at line 999 of file textsearch.cxx.

References i, lcl_findRegex(), and pRegexMatcher.

Referenced by setOptions2().

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

Definition at line 947 of file textsearch.cxx.

References i, lcl_findRegex(), and pRegexMatcher.

Referenced by setOptions2().

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

Definition at line 858 of file textsearch.cxx.

References pRegexMatcher, SAL_INFO, sSrchStr, and sSrchStr2.

Referenced by setOptions2().

SearchResult TextSearch::searchBackward ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
overridevirtual
SearchResult TextSearch::searchForward ( const OUString &  searchStr,
sal_Int32  startPos,
sal_Int32  endPos 
)
overridevirtual
void TextSearch::setOptions ( const css::util::SearchOptions &  options)
overridevirtual

Definition at line 265 of file textsearch.cxx.

References m_aMutex, SAL_WARN, and setOptions2().

void TextSearch::setOptions2 ( const css::util::SearchOptions2 &  options)
overridevirtual
sal_Bool SAL_CALL TextSearch::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 1576 of file textsearch.cxx.

References cppu::supportsService().

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

Definition at line 1340 of file textsearch.cxx.

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

Referenced by setOptions2().

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

Definition at line 1169 of file textsearch.cxx.

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

Referenced by setOptions2().

Member Data Documentation

css::util::SearchOptions2 TextSearch::aSrchPara
private
bool TextSearch::bIsForwardTab
private

Definition at line 77 of file textsearch.hxx.

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

bool TextSearch::bSearchApostrophe
private

Definition at line 72 of file textsearch.hxx.

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

bool TextSearch::bUsePrimarySrchStr
private
bool TextSearch::checkCTLEnd
private

Definition at line 134 of file textsearch.hxx.

Referenced by NSrchBkwrd(), NSrchFrwrd(), and setOptions2().

bool TextSearch::checkCTLStart
private

Definition at line 134 of file textsearch.hxx.

Referenced by NSrchBkwrd(), NSrchFrwrd(), and setOptions2().

FnSrch TextSearch::fnBackward
private

Definition at line 69 of file textsearch.hxx.

Referenced by searchBackward(), and setOptions2().

FnSrch TextSearch::fnForward
private

Definition at line 68 of file textsearch.hxx.

Referenced by searchForward(), and setOptions2().

osl::Mutex TextSearch::m_aMutex
private

Definition at line 51 of file textsearch.hxx.

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

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

Definition at line 52 of file textsearch.hxx.

Referenced by IsDelimiter(), and setOptions2().

OUString TextSearch::maWildcardReversePattern
private

Definition at line 119 of file textsearch.hxx.

Referenced by setOptions2(), and WildcardSrchBkwrd().

OUString TextSearch::maWildcardReversePattern2
private

Definition at line 120 of file textsearch.hxx.

Referenced by setOptions2(), and WildcardSrchBkwrd().

bool TextSearch::mbWildcardAllowSubstring
private

Definition at line 122 of file textsearch.hxx.

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

sal_uInt32 TextSearch::mcWildcardEscapeChar
private

Definition at line 121 of file textsearch.hxx.

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

int TextSearch::nLimit
private

Definition at line 106 of file textsearch.hxx.

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

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

Definition at line 75 of file textsearch.hxx.

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

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

Definition at line 76 of file textsearch.hxx.

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

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

Definition at line 107 of file textsearch.hxx.

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

OUString TextSearch::sSrchStr
private
OUString TextSearch::sSrchStr2
private
css::uno::Reference< css::i18n::XBreakIterator > TextSearch::xBreak
private

Definition at line 108 of file textsearch.hxx.

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

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

Definition at line 58 of file textsearch.hxx.

Referenced by IsDelimiter().

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

Definition at line 60 of file textsearch.hxx.

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

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

Definition at line 61 of file textsearch.hxx.

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


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