![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MCollectible
Inherited By:
None.
Purpose:
Specifies rules for transcoding between Unicode and foreign (non-Unicode) character encodings. Used as input to TRuleBasedTranscoder derived classes.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Deriving classes need to maintain the UniChars, foreign char, and direction information.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
virtual void SetUniChars (const TText & uniChars)
Interface Category:
API.
Purpose:
Allows a rule to be modified by changing the Unicode characters that generate or result from the rule.
Calling Context:
Called while editing transcoders.
Parameters:
- const TText & uniChars -The Unichars for this rule.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void GetUniChars (TText & uniChars) const
Interface Category:
API.
Purpose:
Returns the UniChars for this rule.
Calling Context:
Called internally when adding rules.
Parameters:
- TText & uniChars -The UniChars for this rule.
Return Value:
The UniChars in the parameter uniChars.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTranscodingRule::SetForeignChars
virtual void SetForeignChars (unsigned char * chars, TTextCount bytesPerChar)
Interface Category:
API.
Purpose:
Sets the foreign characters for this transcoding rule.
Calling Context:
Called by the transcoder editor or during initialization.
Parameters:
- unsigned char * chars -Null terminated char string.
- TTextCount bytesPerChar -The number of bytes required to represent a character in this string.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTranscodingRule::GetForeignChars
virtual const unsigned char * GetForeignChars (TTextCount & bytesPerChar) const
Interface Category:
API.
Purpose:
Returns the foreign characters for this rule.
Calling Context:
Called internally by TRuleBasedTranscoder::AddRule.
Parameters:
- TTextCount & bytesPerChar -The number of bytes to represent a character in this string.
Return Value:
A constant pointer to the foreign character string and the number of bytes per character in this string. The pointer is owned by the object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTranscodingRule::GetForeignCharLength
TTextCount GetForeignCharLength () const
Interface Category:
API.
Purpose:
Returns the length of the foreign characters in this rule.
Calling Context:
Called internally by TRuleBasedTranscoder::AddRule.
Parameters:
Return Value:
The length of the foreign characters in this rule.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TTranscodingRule & operator =(const TTranscodingRule & from)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
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:
Called to stream in data.
Parameters:
- TStream & fromWhere -The stream the object is streamed 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:
Called to stream out data.
Parameters:
- TStream & toWhere -The stream the object is streamed 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 long Hash () const
Interface Category:
API.
Purpose:
Generates a hash value.
Calling Context:
Called to generate a hash value.
Parameters:
Return Value:
The numeric value of the hash.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual bool IsEqual (const MCollectible * obj) const
Interface Category:
API.
Purpose:
Compares two objects for equality.
Calling Context:
Called to compare compatible objects.
Parameters:
- const MCollectible * obj -The object to compare to this object.
Return Value:
Returns true if the objects match.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TTranscodingRule ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TTranscodingRule :: ETranscodingDirection GetDirection () const
Interface Category:
API.
Purpose:
Provides the direction of this rule.
Calling Context:
Called by TRuleBasedTranscoder derived classes in AddRule.
Parameters:
Return Value:
The direction of this rule.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetDirection (TTranscodingRule :: ETranscodingDirection direction)
Interface Category:
API.
Purpose:
Modifies the directionality of this transcoding rule.
Calling Context:
Called by the transcoder editors.
Parameters:
- TTranscodingRule :: ETranscodingDirection direction -The transcoding direction for this rule--to or from Unicode.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
- TTranscodingRule (const TText & uniText, unsigned char * foreignChars, TTextCount bytesPerChar, TTranscodingRule :: ETranscodingDirection direction)
- TTranscodingRule ()
- TTranscodingRule (const TTranscodingRule & from)
Interface Category:
API.
Purpose:
- Constructs a rule for transcoding using the specified inputs.
- Default constructor. Constructs an empty rule.
- Copy constructor.
Calling Context:
- Called by a transcoder editor.
- Called by the stream-in operators.
- Called to copy an object.
Parameters:
- const TText & uniText -The source or target Unicodes, depending on the rule direction.
- unsigned char * foreignChars -The source or target foreign characters, depending on the rule direction. Should be Null terminated.
- TTextCount bytesPerChar -The number of bytes per character in the foreignChars parameter.
- TTranscodingRule :: ETranscodingDirection direction -Whether this rule works to Unicode, from Unicode, or both ways.
- Takes no parameters.
- const TTranscodingRule & from -The object to copy.
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.