Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: bamatch.h
Link against: bafl.lib

Class RIncrMatcherBase

RIncrMatcherBase

Support

Supported from 5.0

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).

Defined in RIncrMatcherBase:
AppendChar(), Clear(), DeleteLastChar(), FirstMatchingIndex(), FirstMatchingIndexC(), FirstMatchingIndexF(), IsMatch(), IsMatchC(), IsMatchF(), MatchDes(), MatchLength(), MatchText(), MaxLength(), RIncrMatcherBase(), SetBestMatch(), SetBestMatchC(), SetBestMatchF(), SetMatchText(), ~RIncrMatcherBase()


Construction and destruction


RIncrMatcherBase()

protected: RIncrMatcherBase()

Description

Default constructor.


~RIncrMatcherBase()

virtual ~RIncrMatcherBase();

Description

Virtual destructor, for reimplementation by derived classes.

[Top]


Set match text


AppendChar()

void AppendChar(TChar aLetter);

Description

Appends a character to the end of the match text.

Parameters

TChar aLetter

Character to append


DeleteLastChar()

void DeleteLastChar();

Description

Deletes the final character in the match text.


Clear()

void Clear();

Description

Clears the match text.


SetMatchText()

void SetMatchText(const TDesC& aText);

Description

Sets the match text.

Parameters

const TDesC& aText

String to which to set the match text.

[Top]


Get match text


MatchDes()

protected: virtual TDes& MatchDes()=0;

Description

Gets the match text.

Return value

TDes&

Match text


MatchDes()

protected: virtual const TDes& MatchDes()=0 const;

Description

Gets the match text.

Return value

const TDes&

Match text


MatchLength()

TInt MatchLength() const;

Description

Gets the current length of the match text buffer.


MatchText()

TPtrC MatchText() const;

Description

Gets the match text as a TPtrC.


MaxLength()

TInt MaxLength() const;

Description

Gets the maximum length of the match text buffer.

[Top]


Do matching


FirstMatchingIndex()

TInt FirstMatchingIndex(TInt& aResult,const MDesCArray& 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 MDesCArray& aDesArray

Array of descriptors to search

TInt aStartIndex

Index of aDesArray at which to begin search

Return value

KErrNone

Success

KErrNotFound

No match found


FirstMatchingIndexC()

TInt FirstMatchingIndexC(TInt& aResult,const MDesCArray& 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 MDesCArray& aDesArray

Array of descriptors to search

TInt aStartIndex

Index of aDesArray at which to begin search

Return value

KErrNone

Success

KErrNotFound

No match found


FirstMatchingIndexF()

TInt FirstMatchingIndexF(TInt& aResult,const MDesCArray& 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 MDesCArray& aDesArray

Array of descriptors to search

TInt aStartIndex

Index of aDesArray at which to begin search

Return value

KErrNone

Success

KErrNotFound

No match found


IsMatch()

TBool IsMatch(const TDesC& aBuf) const;

Description

Tests for match, using a binary comparison.

Parameters

const TDesC& aBuf

Text to match

Return value

TBool

True if match found, else false


IsMatchC()

TBool IsMatch(const TDesC& aBuf) const;

Description

Tests for match, using locale collation rules.

Parameters

const TDesC& aBuf

Text to match

Return value

TBool

True if match found, else false


IsMatchF()

TBool IsMatch(const TDesC& aBuf) const;

Description

Tests for match, using locale folding rules.

Parameters

const TDesC& aBuf

Text to match

Return value

TBool

True if match found, else false


SetBestMatch()

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

const TDesC& aBuf

Text to match


SetBestMatchC()

void SetBestMatch(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

const TDesC& aBuf

Text to match


SetBestMatchF()

void SetBestMatch(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

const TDesC& aBuf

Text to match