#include <BAMATCH.H>
Link against:
bafl.lib
class RIncrMatcherBase;
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"
Members
Defined in RIncrMatcherBase
:
AppendChar(TChar)
Appends a character to the end of the match text.
Clear()
Clears the match text.
DeleteLastChar()
Deletes the final character in the match text.
FirstMatchingIndex(TInt &,const MDesC16Array &,TInt)const
Finds the first match in an array, using a binary comparison.
FirstMatchingIndexC(TInt &,const MDesC16Array &,TInt)const
Finds the first match in an array, using locale collation rules.
FirstMatchingIndexF(TInt &,const MDesC16Array &,TInt)const
Finds the first match in an array, using locale folding rules.
IsMatch(const TDesC &)const
Tests for match, using a binary comparison.
IsMatchC(const TDesC &)const
Tests for match, using locale collation rules.
IsMatchF(const TDesC &)const
Tests for match, using locale folding rules.
MatchDes()
Gets the match text.
MatchDes()const
Gets the match text.
MatchLength()const
Gets the current length of the match text buffer.
MatchText()const
Gets the match text as a TPtrC.
MaxLength()const
Gets the maximum length of the match text buffer.
RIncrMatcherBase()
Default constructor.
SetBestMatch(const TDesC &)
Sets the match text to the best match between the match text and the passed buff...
SetBestMatchC(const TDesC &)
Sets the match text to the best match between the match text and the passed buff...
SetBestMatchF(const TDesC &)
Sets the match text to the best match between the match text and the passed buff...
SetMatchText(const TDesC &)
Sets the match text.
~RIncrMatcherBase()
Virtual destructor, for reimplementation by derived classes.
Construction and destruction
IMPORT_C virtual ~RIncrMatcherBase();
Description
Virtual destructor, for reimplementation by derived classes.
protected: inline RIncrMatcherBase();
Description
Default constructor.
protected: virtual TDes& MatchDes()=0;
Description
Gets the match text.
Return value
protected: virtual const TDes& MatchDes() const=0;
Description
Gets the match text.
Return value
inline TInt MaxLength() const;
Description
Gets the maximum length of the match text buffer.
Return value
inline TInt MatchLength() const;
Description
Gets the current length of the match text buffer.
Return value
inline TPtrC MatchText() const;
Description
Gets the match text as a TPtrC.
Return value
inline void Clear();
Description
Clears the match text.
IMPORT_C void DeleteLastChar();
Description
Deletes the final character in the match text.
IMPORT_C void AppendChar(TChar aLetter);
Description
Appends a character to the end of the match text.
Parameters
TChar aLetter |
Character to append
|
|
SetMatchText(const TDesC &)
inline void SetMatchText(const TDesC &aText);
Description
Sets the match text.
Parameters
const TDesC16 &aText |
String to which to set the match text.
|
|
SetBestMatch(const TDesC &)
IMPORT_C void SetBestMatch(const TDesC &aBuf);
Description
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".
Parameters
SetBestMatchC(const TDesC &)
IMPORT_C void SetBestMatchC(const TDesC &aBuf);
Description
Sets the match text to the best match between the match text and the passed buffer, using locale collation rules.
Parameters
SetBestMatchF(const TDesC &)
IMPORT_C void SetBestMatchF(const TDesC &aBuf);
Description
Sets the match text to the best match between the match text and the passed buffer, using locale folding rules.
Parameters
IsMatch(const TDesC &)const
IMPORT_C TBool IsMatch(const TDesC &aBuf) const;
Description
Tests for match, using a binary comparison.
Parameters
Return value
TBool
|
ETrue if match found, else EFalse
|
|
IsMatchC(const TDesC &)const
IMPORT_C TBool IsMatchC(const TDesC &aBuf) const;
Description
Tests for match, using locale collation rules.
Parameters
Return value
TBool
|
ETrue if match found, else EFalse
|
|
IsMatchF(const TDesC &)const
IMPORT_C TBool IsMatchF(const TDesC &aBuf) const;
Description
Tests for match, using locale folding rules.
Parameters
Return value
TBool
|
ETrue if match found, else EFalse
|
|
FirstMatchingIndex(TInt &,const MDesC16Array &,TInt)const
IMPORT_C TInt FirstMatchingIndex(TInt &aResult, const MDesC16Array &aDesArray, TInt aStartIndex=0) const;
Description
Finds the first match in an array, using a binary comparison.
Parameters
TInt &aResult |
On return, index of the first match in aDesArray
|
const MDesC16Array &aDesArray |
Array of descriptors to search
|
TInt aStartIndex |
Index of aDesArray at which to begin search
|
|
Return value
TInt
|
KErrNone if success or KErrNotFound if no match is found
|
|
FirstMatchingIndexC(TInt &,const MDesC16Array &,TInt)const
IMPORT_C TInt FirstMatchingIndexC(TInt &aResult, const MDesC16Array &aDesArray, TInt aStartIndex=0) const;
Description
Finds the first match in an array, using locale collation rules.
Parameters
TInt &aResult |
On return, index of the first match in aDesArray
|
const MDesC16Array &aDesArray |
Array of descriptors to search
|
TInt aStartIndex |
Index of aDesArray at which to begin search
|
|
Return value
TInt
|
KErrNone if success or KErrNotFound if no match is found
|
|
FirstMatchingIndexF(TInt &,const MDesC16Array &,TInt)const
IMPORT_C TInt FirstMatchingIndexF(TInt &aResult, const MDesC16Array &aDesArray, TInt aStartIndex=0) const;
Description
Finds the first match in an array, using locale folding rules.
Parameters
TInt &aResult |
On return, index of the first match in aDesArray
|
const MDesC16Array &aDesArray |
Array of descriptors to search
|
TInt aStartIndex |
Index of aDesArray at which to begin search
|
|
Return value
TInt
|
KErrNone if success or KErrNotFound if no match is found
|
|