Class: TTranscodingRule

Declaration: Transcoding.h

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.

Member Function: TTranscodingRule::SetUniChars

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTranscodingRule::GetUniChars

virtual void GetUniChars (TText & uniChars) const

Interface Category:

API.

Purpose:

Returns the UniChars for this rule.

Calling Context:

Called internally when adding rules.

Parameters:

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:

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:

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.

Member Function: TTranscodingRule::operator=

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.

Member Function: TTranscodingRule::operator<<=

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

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

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

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

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

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: TTranscodingRule::Hash

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.

Member Function: TTranscodingRule::IsEqual

virtual bool IsEqual (const MCollectible * obj) const

Interface Category:

API.

Purpose:

Compares two objects for equality.

Calling Context:

Called to compare compatible objects.

Parameters:

Return Value:

Returns true if the objects match.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTranscodingRule::~TTranscodingRule

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.

Member Function: TTranscodingRule::GetDirection

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.

Member Function: TTranscodingRule::SetDirection

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTranscodingRule::TTranscodingRule

  1. TTranscodingRule (const TText & uniText, unsigned char * foreignChars, TTextCount bytesPerChar, TTranscodingRule :: ETranscodingDirection direction)
  2. TTranscodingRule ()
  3. TTranscodingRule (const TTranscodingRule & from)

Interface Category:

API.

Purpose:

  1. Constructs a rule for transcoding using the specified inputs.
  2. Default constructor. Constructs an empty rule.
  3. Copy constructor.

Calling Context:

  1. Called by a transcoder editor.
  2. Called by the stream-in operators.
  3. 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.