Class: THexTransliterator

Declaration: Transliterate.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TTransliterator

Inherited By:

None.

Purpose:

THexTransliterator, derived from TTransliterator, translates hex numbers between one and four digits into their unicode representations. When used inline, THexTransliterator provides a simple input function for generating characters that cannot be entered with a keyboard. Note that each number should be preceded by '%', ie., %12f3%3049.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

THexTransliterator 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: THexTransliterator::THexTransliterator

THexTransliterator ()

Interface Category:

API.

Purpose:

Default constructor.

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: THexTransliterator::~THexTransliterator

virtual ~ THexTransliterator ()

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: THexTransliterator::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: THexTransliterator::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: THexTransliterator::operator=

THexTransliterator & operator =(const THexTransliterator & rule)

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: THexTransliterator::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: THexTransliterator::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: THexTransliterator::GetTranslateRange

virtual void GetTranslateRange (const TText & currentText, const TTextRange & newTextRange, TTextRange & rangeToTranslate) const

Interface Category:

API.

Purpose:

Given the current text, this function determines how much preceding/succeeding context is needed and returns the range that can be passed into the Translate functions as sourceRange.

Calling Context:

This function is called internally by TranslateInline.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This protected function overrides the inherited TTransliterator function.

Member Function: THexTransliterator::GetMaxPreceed

virtual TTextCount GetMaxPreceed () const

Interface Category:

API.

Purpose:

The maximum number of characters before the current offset that needs to be considered for correct forward translation.

Calling Context:

This function is called by GetTranslateRange.

Parameters:

Return Value:

Maximum number of preceding characters.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This protected function overrides the inherited TTransliterator function.

Member Function: THexTransliterator::GetMaxSucceed

virtual TTextCount GetMaxSucceed () const

Interface Category:

API.

Purpose:

The maximum number of characters after the current offset that needs to be considered for correct forward translation.

Calling Context:

This function is called by GetTranslateRange.

Parameters:

Return Value:

Maximum number of preceding characters.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This protected function overrides the inherited TTransliterator function.

Member Function: THexTransliterator::DoTranslateBack

virtual bool DoTranslateBack (TText & sourceText, const TTextRange & sourceRange, TTextRange & replacementRange, TTextCount & numNewChars) const

Interface Category:

API.

Purpose:

Performs the actual translate back operation.

Calling Context:

Called by the public translate back functions.

Parameters:

Return Value:

Returns true if text is translated back.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This protected function overrides the inherited TTransliterator function.

Member Function: THexTransliterator::DoTranslate

virtual bool DoTranslate (TText & sourceText, const TTextRange & sourceRange, TTextRange & replacementRange, TTextCount & numNewChars) const

Interface Category:

API.

Purpose:

Performs the actual translate operation.

Calling Context:

Called by the public translate functions.

Parameters:

Return Value:

Returns true if text is translated.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This protected function overrides the inherited TTransliterator function.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.