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.
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.
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.
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.
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:
- TStream & fromWhere -The stream the object streams itself in from.
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.
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:
- TStream & toWhere -The stream the object streams itself out to.
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.
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:
- const TText & currentText -Current text which includes new input text.
- const TTextRange & newTextRange -The range of newly input text.
- TTextRange & rangeToTranslate -Result range.
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.
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.
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.
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:
- TText & sourceText -The text to translate back.
- const TTextRange & sourceRange -The range of text to translate back.
- TTextRange & replacementRange -The range of text replaced by the translation.
- TTextCount & numNewChars -The number of new characters introduced by the translation operation.
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.
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:
- TText & sourceText -The text to translate.
- const TTextRange & sourceRange -The range of text to translate.
- TTextRange & replacementRange -The range of text replaced by the translation.
- TTextCount & numNewChars -The number of new characters introduced by the translation operation.
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.