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

CompoundTransliterator Class Reference

A transliterator that is composed of two or more other transliterator objects linked together. More...

#include <cpdtrans.h>

Inheritance diagram for CompoundTransliterator::

Transliterator List of all members.

Public Methods

 CompoundTransliterator (Transliterator *const transliterators[], int32_t transliteratorCount, UnicodeFilter *adoptedFilter=0)
 Constructs a new compound transliterator given an array of transliterators. More...

 CompoundTransliterator (const UnicodeString &id, UTransDirection dir, UnicodeFilter *adoptedFilter, UParseError &parseError, UErrorCode &status)
 Constructs a new compound transliterator. More...

 CompoundTransliterator (const UnicodeString &id, UParseError &parseError, UErrorCode &status)
 Constructs a new compound transliterator in the FORWARD direction with a NULL filter. More...

virtual ~CompoundTransliterator ()
 Destructor. More...

 CompoundTransliterator (const CompoundTransliterator &)
 Copy constructor. More...

CompoundTransliterator & operator= (const CompoundTransliterator &)
 Assignment operator. More...

Transliteratorclone (void) const
 Transliterator API. More...

virtual int32_t getCount (void) const
 Returns the number of transliterators in this chain. More...

virtual const TransliteratorgetTransliterator (int32_t index) const
 Returns the transliterator at the given index in this chain. More...

void setTransliterators (Transliterator *const transliterators[], int32_t count)
 Sets the transliterators. More...

void adoptTransliterators (Transliterator *adoptedTransliterators[], int32_t count)
 Adopts the transliterators. More...

virtual UnicodeStringtoRules (UnicodeString &result, UBool escapeUnprintable) const
 Override Transliterator: Create a rule string that can be passed to createFromRules() to recreate this transliterator. More...

virtual void handleTransliterate (Replaceable &text, UTransPosition &index, UBool incremental) const
 Implements Transliterator::handleTransliterate. More...


Private Methods

 CompoundTransliterator (const UnicodeString &ID, const UnicodeString &idBlock, int32_t idSplitPoint, Transliterator *adoptedTrans, UErrorCode &status)
 Private constructor for compound RBTs. More...

 CompoundTransliterator (UVector &list, UParseError &parseError, UErrorCode &status)
 Private constructor for Transliterator. More...

void init (const UnicodeString &id, UTransDirection direction, int32_t idSplitPoint, Transliterator *adoptedRbt, UBool fixReverseID, UErrorCode &status)
void init (UVector &list, UTransDirection direction, UBool fixReverseID, UErrorCode &status)
UnicodeString joinIDs (Transliterator *const transliterators[], int32_t transCount)
 Return the IDs of the given list of transliterators, concatenated with ';' delimiting them. More...

void freeTransliterators (void)
void computeMaximumContextLength (void)

Private Attributes

Transliterator ** trans
int32_t count
int32_t compoundRBTIndex
 For compound RBTs (those with an id block before and/or after the main rule block) we record the index of the RBT here. More...


Friends

class Transliterator
class TransliteratorAlias

Detailed Description

A transliterator that is composed of two or more other transliterator objects linked together.

For example, if one transliterator transliterates from script A to script B, and another transliterates from script B to script C, the two may be combined to form a new transliterator from A to C.

Composed transliterators may not behave as expected. For example, inverses may not combine to form the identity transliterator. See the class documentation for Transliterator for details.

Copyright © IBM Corporation 1999. All rights reserved.

Author:
Alan Liu
Deprecated:
To be removed after 2002-sep-30.

Definition at line 37 of file cpdtrans.h.


Constructor & Destructor Documentation

CompoundTransliterator::CompoundTransliterator Transliterator *const    transliterators[],
int32_t    transliteratorCount,
UnicodeFilter   adoptedFilter = 0
 

Constructs a new compound transliterator given an array of transliterators.

The array of transliterators may be of any length, including zero or one, however, useful compound transliterators have at least two components.

Parameters:
transliterators  array of Transliterator objects
transliteratorCount  The number of Transliterator objects in transliterators.
filter  the filter. Any character for which filter.contains() returns false will not be altered by this transliterator. If filter is null then no filtering is applied.
Deprecated:
To be removed after 2002-sep-30; use the Transliterator::createInstance factory method.

CompoundTransliterator::CompoundTransliterator const UnicodeString   id,
UTransDirection    dir,
UnicodeFilter   adoptedFilter,
UParseError   parseError,
UErrorCode   status
 

Constructs a new compound transliterator.

Parameters:
id  compound ID
dir  either UTRANS_FORWARD or UTRANS_REVERSE
adoptedFilter  a global filter for this compound transliterator or NULL
Deprecated:
To be removed after 2002-sep-30; use the Transliterator::createInstance factory method.

CompoundTransliterator::CompoundTransliterator const UnicodeString   id,
UParseError   parseError,
UErrorCode   status
 

Constructs a new compound transliterator in the FORWARD direction with a NULL filter.

Deprecated:
To be removed after 2002-sep-30; use the Transliterator::createInstance factory method.

virtual CompoundTransliterator::~CompoundTransliterator   [virtual]
 

Destructor.

Deprecated:
To be removed after 2002-sep-30.

CompoundTransliterator::CompoundTransliterator const CompoundTransliterator &   
 

Copy constructor.

Deprecated:
To be removed after 2002-sep-30; use the Transliterator::createInstance factory method.

CompoundTransliterator::CompoundTransliterator const UnicodeString   ID,
const UnicodeString   idBlock,
int32_t    idSplitPoint,
Transliterator   adoptedTrans,
UErrorCode   status
[private]
 

Private constructor for compound RBTs.

Construct a compound transliterator using the given idBlock, with the adoptedTrans inserted at the idSplitPoint.

CompoundTransliterator::CompoundTransliterator UVector   list,
UParseError   parseError,
UErrorCode   status
[private]
 

Private constructor for Transliterator.


Member Function Documentation

void CompoundTransliterator::adoptTransliterators Transliterator   adoptedTransliterators[],
int32_t    count
 

Adopts the transliterators.

Deprecated:
To be removed after 2002-sep-30.

Transliterator* CompoundTransliterator::clone void    const [virtual]
 

Transliterator API.

Deprecated:
To be removed after 2002-sep-30.

Reimplemented from Transliterator.

void CompoundTransliterator::computeMaximumContextLength void    [private]
 

void CompoundTransliterator::freeTransliterators void    [private]
 

virtual int32_t CompoundTransliterator::getCount void    const [virtual]
 

Returns the number of transliterators in this chain.

Returns:
number of transliterators in this chain.
Deprecated:
To be removed after 2002-sep-30.

virtual const Transliterator& CompoundTransliterator::getTransliterator int32_t    index const [virtual]
 

Returns the transliterator at the given index in this chain.

Parameters:
index  index into chain, from 0 to getCount() - 1
Returns:
transliterator at the given index
Deprecated:
To be removed after 2002-sep-30.

virtual void CompoundTransliterator::handleTransliterate Replaceable   text,
UTransPosition   index,
UBool    incremental
const [virtual]
 

Implements Transliterator::handleTransliterate.

Deprecated:
To be removed after 2002-sep-30.

Reimplemented from Transliterator.

void CompoundTransliterator::init UVector   list,
UTransDirection    direction,
UBool    fixReverseID,
UErrorCode   status
[private]
 

void CompoundTransliterator::init const UnicodeString   id,
UTransDirection    direction,
int32_t    idSplitPoint,
Transliterator   adoptedRbt,
UBool    fixReverseID,
UErrorCode   status
[private]
 

UnicodeString CompoundTransliterator::joinIDs Transliterator *const    transliterators[],
int32_t    transCount
[private]
 

Return the IDs of the given list of transliterators, concatenated with ';' delimiting them.

Equivalent to the perlish expression join(';', map($_.getID(), transliterators).

CompoundTransliterator& CompoundTransliterator::operator= const CompoundTransliterator &   
 

Assignment operator.

Deprecated:
To be removed after 2002-sep-30.

void CompoundTransliterator::setTransliterators Transliterator *const    transliterators[],
int32_t    count
 

Sets the transliterators.

Deprecated:
To be removed after 2002-sep-30.

virtual UnicodeString& CompoundTransliterator::toRules UnicodeString   result,
UBool    escapeUnprintable
const [virtual]
 

Override Transliterator: Create a rule string that can be passed to createFromRules() to recreate this transliterator.

Parameters:
result  the string to receive the rules. Previous contents will be deleted.
escapeUnprintable  if TRUE then convert unprintable character to their hex escape representations, \uxxxx or \Uxxxxxxxx. Unprintable characters are those other than U+000A, U+0020..U+007E.
Deprecated:
To be removed after 2002-sep-30.

Reimplemented from Transliterator.


Friends And Related Function Documentation

friend class Transliterator [friend]
 

Definition at line 171 of file cpdtrans.h.

friend class TransliteratorAlias [friend]
 

Definition at line 172 of file cpdtrans.h.


Member Data Documentation

int32_t CompoundTransliterator::compoundRBTIndex [private]
 

For compound RBTs (those with an id block before and/or after the main rule block) we record the index of the RBT here.

Otherwise, this should have a value of -1. We need this information to implement toRules().

Definition at line 49 of file cpdtrans.h.

int32_t CompoundTransliterator::count [private]
 

Definition at line 41 of file cpdtrans.h.

Transliterator** CompoundTransliterator::trans [private]
 

Definition at line 39 of file cpdtrans.h.


The documentation for this class was generated from the following file:
Generated on Tue Apr 9 11:30:32 2002 for ICU 2.1 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001