Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

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 UnicodeSet

Public Member Functions

virtual ~UnicodeFilter ()
 Destructor .
virtual UBool contains (UChar32 c) const =0
 Returns true for characters that are in the selected subset.
virtual UnicodeMatchertoMatcher () const
 UnicodeFunctor API.
UnicodeStringtoPattern (UnicodeString &result, UBool escapeUnprintable) const
 UnicodeMatcher API.
UBool matchesIndexValue (uint8_t v) const
 UnicodeMatcher API.
virtual UMatchDegree matches (const Replaceable &text, int32_t &offset, int32_t limit, UBool incremental)
 Implement UnicodeMatcher API.
virtual void setData (const TransliterationRuleData *)
 UnicodeFunctor API.

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


Member Function Documentation

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.

Implemented in UnicodeSet.

UBool UnicodeFilter::matchesIndexValue uint8_t  v  )  const [virtual]
 

UnicodeMatcher API.

This class stubs this out.

Implements UnicodeMatcher.

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

UnicodeFunctor API.

Nothing to do.

Implements UnicodeFunctor.

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.

Implements UnicodeMatcher.

Reimplemented in UnicodeSet.


The documentation for this class was generated from the following file:
Generated on Tue Jul 26 18:12:04 2005 for ICU 2.1 by  doxygen 1.4.3-20050530