Class: TTransliteratorHandle

Declaration: Transliterate.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

None.

Purpose:

TTransliteratorHandle is a lightweight reference to a TTransliterator. It can be constructed and destroyed freely. It is used by any client who needs to refer to a transliterator in the system, including the typing configuration.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TTransliteratorHandle is a concrete class designed to be used directly. It can be derived to add functionality. There are no special requirements for deriving.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TTransliteratorHandle::~TTransliteratorHandle

virtual ~ TTransliteratorHandle ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

This function is designed to be called directly and has no special requirements.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTransliteratorHandle::GetMaxExpandFactor

virtual TTextCount GetMaxExpandFactor () const

Interface Category:

API.

Purpose:

Returns the maximum expansion possible for this transliterator when doing forward translation. For example, if any single character can turn into four characters, the expansion factor is 4.

Calling Context:

This function is designed to be called directly and has no special requirements.

Parameters:

Return Value:

The expansion factor.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTransliteratorHandle::GetMaxBackExpandFactor

virtual TTextCount GetMaxBackExpandFactor () const

Interface Category:

API.

Purpose:

Return the maximum expansion possible for this transliterator when doing backward translation. For example, if any single character can turn into four characters, the expansion factor is 4.

Calling Context:

This function is designed to be called directly and has no special requirements.

Parameters:

Return Value:

The expansion factor.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTransliteratorHandle::CopyTransliterator

virtual TTransliterator * CopyTransliterator () const

Interface Category:

API.

Purpose:

Access the transliterator referred to by this handle. Returns a copy of the referenced transliterator. Caller owns the storage for the object returned.

Calling Context:

This function is designed to be called directly and has no special requirements.

Parameters:

Return Value:

TTransliterator * -Copy of the transliterator referred to by this handle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTransliteratorHandle::GetName

  1. virtual void GetName (TLocalizableName & name) const

Interface Category:

API.

Purpose:

Returns the localizable name of the transliterator to which this handle refers.

Calling Context:

This function is designed to be called directly and has no special requirements.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTransliteratorHandle::operator=

TTransliteratorHandle & operator =(const TTransliteratorHandle & tran)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

This function is designed to be called directly and has no special requirements.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTransliteratorHandle::operator<<=

virtual TStream & operator <<= (TStream & fromWhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

This function is designed to be called directly and has no special requirements.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTransliteratorHandle::operator>>=

virtual TStream & operator >>=(TStream & toWhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

This function is designed to be called directly and has no special requirements.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTransliteratorHandle::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Generates a hash value.

Calling Context:

This function is designed to be called directly and has no special requirements.

Parameters:

Return Value:

The numeric value of the hash.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTransliteratorHandle::TranslateInline

  1. virtual bool TranslateInline (const TText & currentText, const TTextRange & newRange, const TText & newText, TText & replacementText, TTextRange & replacementRange) const
  2. virtual bool TranslateInline (TText & currentText, const TTextRange & newRange, const TText & newText, TTextRange & replacementRange, TTextCount & numNewChars) const

Interface Category:

API.

Purpose:

  1. Invoked for inline transliteration such as when the user is typing. Returns the replacement text and range so that the caller can edit the input text.
  2. Similar to the first function, except that the text is changed directly.

Calling Context:

This function is designed to be called directly and has no special requirements.

Parameters:

Return Value:

Returns true if translation was performed.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Calls corresponding function on the referenced transliterator.

Member Function: TTransliteratorHandle::TranslateBack

  1. virtual bool TranslateBack (TText & text) const
  2. virtual bool TranslateBack (const TText & sourceText, const TTextRange & sourceRange, TText & replacementText, TTextRange & replacementRange) const
  3. virtual bool TranslateBack (TText & sourceText, const TTextRange & sourceRange, TTextRange & replacementRange, TTextCount & numNewChars) const

Interface Category:

API.

Purpose:

  1. This function directly translates back the specified text object.
  2. Given a text object (sourceText) and a range within it (sourceRange), this function returns the replacement (translated back) text and range.
  3. Given a text object and a range within it, this function calls DoTranslateBack to directly change the text object and return the range replaced and the number of new characters inserted.

Calling Context:

This function is designed to be called directly and has no special requirements. It is also called internally by functions such as TranslateInline.

Parameters:

Return Value:

Returns true if translation back was performed.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Calls corresponding function on the referenced transliterator.

Member Function: TTransliteratorHandle::Translate

  1. virtual bool Translate (TText & text) const
  2. virtual bool Translate (const TText & sourceText, const TTextRange & sourceRange, TText & replacementText, TTextRange & replacementRange) const
  3. virtual bool Translate (TText & sourceText, const TTextRange & sourceRange, TTextRange & replacementRange, TTextCount & numNewChars) const

Interface Category:

API.

Purpose:

  1. This function directly translates the specified text object.
  2. Given a text object (sourceText) and a range within it (sourceRange), this function returns the replacement text and range.
  3. Given a text object and a range within it, this function directly changes the text object and returns the range replaced and the number of new characters inserted.

Calling Context:

This function is designed to be called directly and has no special requirements. It is also called internally by functions such as TranslateInline.

Parameters:

Return Value:

Returns true if translation was performed

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Calls corresponding function on the referenced transliterator.

Member Function: TTransliteratorHandle::TTransliteratorHandle

  1. TTransliteratorHandle ()
  2. TTransliteratorHandle (const TTransliterator * transliterator)
  3. TTransliteratorHandle (const TLocalizableName & name)
  4. TTransliteratorHandle (const TTransliteratorHandle & tran)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Constructs a handle object for the argument transliterator. Does not own the argument.
  3. Constructs a handle object with a particular name. Will attempt to find a transliterator object with that name and construct a handle for it. If not found, an empty handle will be constructed.
  4. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. This function is designed to be called directly and has no special requirements.
  3. This function is designed to be called directly and has no special requirements.
  4. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.