RIncrMatcherBase Class Reference

#include <bamatch.h>

Link against: bafl.lib

class RIncrMatcherBase
Public Member Functions
virtual ~RIncrMatcherBase()
IMPORT_C voidAppendChar(TChar)
voidClear()
IMPORT_C voidDeleteLastChar()
IMPORT_C TIntFirstMatchingIndex(TInt &, const MDesCArray &, TInt)
IMPORT_C TIntFirstMatchingIndexC(TInt &, const MDesCArray &, TInt)
IMPORT_C TIntFirstMatchingIndexF(TInt &, const MDesCArray &, TInt)
IMPORT_C TBoolIsMatch(const TDesC &)
IMPORT_C TBoolIsMatchC(const TDesC &)
IMPORT_C TBoolIsMatchF(const TDesC &)
TInt MatchLength()
TPtrC MatchText()
TInt MaxLength()
IMPORT_C voidSetBestMatch(const TDesC &)
IMPORT_C voidSetBestMatchC(const TDesC &)
IMPORT_C voidSetBestMatchF(const TDesC &)
voidSetMatchText(const TDesC &)
Protected Member Functions
RIncrMatcherBase()
pure virtual TDes &MatchDes()
pure virtual const TDes &MatchDes()

Detailed Description

Base class for incremental matcher classes.

An incremental matcher compares two text buffers from left-to-right. For example, the match between "garage" and "gander" is "ga".

The class provides the interface for getting and setting the text to be matched against, and for performing match tests. Each type of match test is available in three versions, one using binary comparison, one using locale collation rules (comparison of strings to produce a dictionary-like ('lexicographic') ordering, e.g. ignoring punctuation), and one using locale folding rules (e.g. ignoring case).

"bafl.lib"
Since
5.0

Constructor & Destructor Documentation

RIncrMatcherBase ( )

RIncrMatcherBase()[protected, inline]

Default constructor.

~RIncrMatcherBase ( )

IMPORT_C~RIncrMatcherBase()[virtual]

Virtual destructor, for reimplementation by derived classes.

Member Function Documentation

AppendChar ( TChar )

IMPORT_C voidAppendChar(TCharaLetter)

Appends a character to the end of the match text.

ParameterDescription
aLetterCharacter to append

Clear ( )

voidClear()[inline]

Clears the match text.

DeleteLastChar ( )

IMPORT_C voidDeleteLastChar()

Deletes the final character in the match text.

FirstMatchingIndex ( TInt &, const MDesCArray &, TInt )

IMPORT_C TIntFirstMatchingIndex(TInt &aResult,
const MDesCArray &aDesArray,
TIntaStartIndex = 0
)const

Finds the first match in an array, using a binary comparison.

ParameterDescription
aResultOn return, index of the first match in aDesArray
aDesArrayArray of descriptors to search
aStartIndexIndex of aDesArray at which to begin search

Returns: KErrNone if success or KErrNotFound if no match is found

FirstMatchingIndexC ( TInt &, const MDesCArray &, TInt )

IMPORT_C TIntFirstMatchingIndexC(TInt &aResult,
const MDesCArray &aDesArray,
TIntaStartIndex = 0
)const

Finds the first match in an array, using locale collation rules.

ParameterDescription
aResultOn return, index of the first match in aDesArray
aDesArrayArray of descriptors to search
aStartIndexIndex of aDesArray at which to begin search

Returns: KErrNone if success or KErrNotFound if no match is found

FirstMatchingIndexF ( TInt &, const MDesCArray &, TInt )

IMPORT_C TIntFirstMatchingIndexF(TInt &aResult,
const MDesCArray &aDesArray,
TIntaStartIndex = 0
)const

Finds the first match in an array, using locale folding rules.

ParameterDescription
aResultOn return, index of the first match in aDesArray
aDesArrayArray of descriptors to search
aStartIndexIndex of aDesArray at which to begin search

Returns: KErrNone if success or KErrNotFound if no match is found

IsMatch ( const TDesC & )

IMPORT_C TBoolIsMatch(const TDesC &aBuf)const

Tests for match, using a binary comparison.

ParameterDescription
aBufText to match

Returns: ETrue if match found, else EFalse

IsMatchC ( const TDesC & )

IMPORT_C TBoolIsMatchC(const TDesC &aBuf)const

Tests for match, using locale collation rules.

ParameterDescription
aBufText to match

Returns: ETrue if match found, else EFalse

IsMatchF ( const TDesC & )

IMPORT_C TBoolIsMatchF(const TDesC &aBuf)const

Tests for match, using locale folding rules.

ParameterDescription
aBufText to match

Returns: ETrue if match found, else EFalse

MatchDes ( )

TDes &MatchDes()[protected, pure virtual]

Gets the match text.

Returns: Match text

MatchDes ( )

const TDes &MatchDes()const [protected, pure virtual]

Gets the match text.

Returns: Match text

MatchLength ( )

TInt MatchLength()const [inline]

Gets the current length of the match text buffer.

MatchText ( )

TPtrC MatchText()const [inline]

Gets the match text as a TPtrC.

MaxLength ( )

TInt MaxLength()const [inline]

Gets the maximum length of the match text buffer.

SetBestMatch ( const TDesC & )

IMPORT_C voidSetBestMatch(const TDesC &aBuf)

Sets the match text to the best match between the match text and the passed buffer, using a binary comparision.

For example, if the original match text is "goose" and the passed buffer is "gooSE", the match text would be changed to "goo".

ParameterDescription
aBufText to match

SetBestMatchC ( const TDesC & )

IMPORT_C voidSetBestMatchC(const TDesC &aBuf)

Sets the match text to the best match between the match text and the passed buffer, using locale collation rules.

ParameterDescription
aBufText to match

SetBestMatchF ( const TDesC & )

IMPORT_C voidSetBestMatchF(const TDesC &aBuf)

Sets the match text to the best match between the match text and the passed buffer, using locale folding rules.

ParameterDescription
aBufText to match

SetMatchText ( const TDesC & )

voidSetMatchText(const TDesC &aText)[inline]

Sets the match text.

ParameterDescription
aTextString to which to set the match text.