Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

UnicodeFilter Class Reference

UnicodeFilter defines a protocol for selecting a subset of the full range (U+0000 to U+10FFFF) of Unicode characters. More...

#include <unifilt.h>

Inheritance diagram for UnicodeFilter::

UnicodeFunctor UnicodeMatcher UObject UnicodeSet List of all members.

Public Methods

virtual ~UnicodeFilter ()
 Destructor. More...

virtual UBool contains (UChar32 c) const=0
 Returns true for characters that are in the selected subset. More...

virtual UnicodeMatchertoMatcher () const
 UnicodeFunctor API. More...

UnicodeStringtoPattern (UnicodeString &result, UBool escapeUnprintable) const
 UnicodeMatcher API. More...

UBool matchesIndexValue (uint8_t v) const
 UnicodeMatcher API. More...

virtual UMatchDegree matches (const Replaceable &text, int32_t &offset, int32_t limit, UBool incremental)
 Implement UnicodeMatcher API. More...

virtual void setData (const TransliterationRuleData *)
 UnicodeFunctor API. More...

virtual UClassID getDynamicClassID () const
 ICU "poor man's RTTI", returns a UClassID for the actual class. More...

virtual void addMatchSetTo (UnicodeSet &toUnionTo) const
 Stubbed out implementation of UnicodeMatcher API. More...


Static Public Methods

UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class. More...


Protected Methods

 UnicodeFilter ()

Static Private Attributes

const char fgClassID
 The address of this static class variable serves as this class's ID for ICU "poor man's RTTI". More...


Detailed Description

UnicodeFilter defines a protocol for selecting a subset of the full range (U+0000 to U+10FFFF) of Unicode characters.

Currently, filters are used in conjunction with classes like Transliterator to only process selected characters through a transformation.

Note: UnicodeFilter currently stubs out two pure virtual methods of its base class, UnicodeMatcher. These methods are toPattern() and matchesIndexValue(). This is done so that filter classes that are not actually used as matchers -- specifically, those in the UnicodeFilterLogic component, and those in tests -- can continue to work without defining these methods. As long as a filter is not used in an RBT during real transliteration, these methods will not be called. However, this breaks the UnicodeMatcher base class protocol, and it is not a correct solution.

In the future we may revisit the UnicodeMatcher / UnicodeFilter hierarchy and either redesign it, or simply remove the stubs in UnicodeFilter and force subclasses to implement the full UnicodeMatcher protocol.

See also:
UnicodeFilterLogic
Stable:

Definition at line 50 of file unifilt.h.


Constructor & Destructor Documentation

UnicodeFilter::~UnicodeFilter   [inline, virtual]
 

Destructor.

Stable:

Definition at line 133 of file unifilt.h.

UnicodeFilter::UnicodeFilter   [inline, protected]
 

Definition at line 132 of file unifilt.h.


Member Function Documentation

virtual void UnicodeFilter::addMatchSetTo UnicodeSet   toUnionTo const [virtual]
 

Stubbed out implementation of UnicodeMatcher API.

Parameters:
toUnionTo  the set into which to union the source characters
Returns:
a reference to toUnionTo

Reimplemented from UnicodeMatcher.

Reimplemented in UnicodeSet.

virtual UBool UnicodeFilter::contains UChar32    c const [pure virtual]
 

Returns true for characters that are in the selected subset.

In other words, if a character is to be filtered, then contains() returns false.

Stable:

Reimplemented in UnicodeSet.

virtual UClassID UnicodeFilter::getDynamicClassID void    const [inline, virtual]
 

ICU "poor man's RTTI", returns a UClassID for the actual class.

Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Reimplemented from UnicodeFunctor.

Reimplemented in UnicodeSet.

Definition at line 103 of file unifilt.h.

UClassID UnicodeFilter::getStaticClassID void    [inline, static]
 

ICU "poor man's RTTI", returns a UClassID for this class.

Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Reimplemented from UnicodeFunctor.

Reimplemented in UnicodeSet.

Definition at line 110 of file unifilt.h.

Referenced by UnicodeSet::getDynamicClassID().

virtual UMatchDegree UnicodeFilter::matches const Replaceable   text,
int32_t   offset,
int32_t    limit,
UBool    incremental
[virtual]
 

Implement UnicodeMatcher API.

Reimplemented from UnicodeMatcher.

Reimplemented in UnicodeSet.

UBool UnicodeFilter::matchesIndexValue uint8_t    v const [virtual]
 

UnicodeMatcher API.

This class stubs this out.

Reimplemented from UnicodeMatcher.

Reimplemented in UnicodeSet.

virtual void UnicodeFilter::setData const TransliterationRuleData   [inline, virtual]
 

UnicodeFunctor API.

Nothing to do.

Reimplemented from UnicodeFunctor.

Definition at line 96 of file unifilt.h.

virtual UnicodeMatcher* UnicodeFilter::toMatcher   const [virtual]
 

UnicodeFunctor API.

Cast 'this' to a UnicodeMatcher* pointer and return the pointer.

Reimplemented from UnicodeFunctor.

UnicodeString& UnicodeFilter::toPattern UnicodeString   result,
UBool    escapeUnprintable
const [virtual]
 

UnicodeMatcher API.

This class stubs this out.

Reimplemented from UnicodeMatcher.

Reimplemented in UnicodeSet.


Member Data Documentation

const char UnicodeFilter::fgClassID [static, private]
 

The address of this static class variable serves as this class's ID for ICU "poor man's RTTI".

Reimplemented from UnicodeFunctor.

Reimplemented in UnicodeSet.

Definition at line 129 of file unifilt.h.


The documentation for this class was generated from the following file:
Generated on Thu Aug 15 14:14:15 2002 for ICU 2.2 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001