![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
THybridNumberFormatter
Inherited By:
None.
Purpose:
This class, derived from THybridNumberFormatter, handles numbers expressed using the Han numbering system of East Asia.
Instantiation:
Always allocate on the heap.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- THanNumberFormatter ()
- THanNumberFormatter (EHanSimplification simplification, EHanNumberType numberType)
- THanNumberFormatter (const THanNumberFormatter & format)
Interface Category:
API.
Purpose:
- Default constructor. Creates a formatter with the following characteristics: uses the traditional character forms, uses the standard numbering systems, and does not handle numbers less than -1.
- Creates a number formatter using the specified character forms or numbering system. The formatter created by this constructor has the other characteristics of the default Han number formatter.
- Copy constructor.
Calling Context:
- Call directly to instantiate this class.
- Call directly to instantiate a formatter that uses different character forms or a different numbering system than the default formatter.
- Called to copy an object.
Parameters:
- Takes no parameters.
- EHanSimplification simplification -Specifies the type of character forms to use.
- EHanNumberType numberType -Specifies which variation of the Han numbering system to use.
- const THanNumberFormatter & format -Specifies object to copy.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ THanNumberFormatter ()
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: THanNumberFormatter::GetHanSimplification
EHanSimplification GetHanSimplification () const
Interface Category:
API.
Purpose:
Queries which set of character forms are being used.
Calling Context:
Call directly to access this information.
Parameters:
Return Value:
EHanSimplification enum value specifying either simplified or traditional character forms.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: THanNumberFormatter::SetHanSimplification
void SetHanSimplification (EHanSimplification)
Interface Category:
API.
Purpose:
Sets the formatter to use either simplified or traditional character forms.
Calling Context:
Call directly to change the current setting of the formatter.
Parameters:
- EHanSimplification -Specifies which set of character forms to use.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
EHanNumberType GetHanNumberType () const
Interface Category:
API.
Purpose:
Queries which variation of the Han numbering system is being used.
Calling Context:
Call directly to access this information.
Parameters:
Return Value:
EHanNumberType value specifying one of the variations.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
void SetHanNumberType (EHanNumberType)
Interface Category:
API.
Purpose:
Sets the formatter to use a specific variation of the Han numbering system.
Calling Context:
Call directly to change the current setting of the formatter.
Parameters:
- EHanNumberType -Specifies which numbering system to use.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
THanNumberFormatter & operator =(const THanNumberFormatter &)
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 & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
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 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 streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws a TStandardException if this version of the formatter cannot be used on the current version of the system.
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:
Same as MCollectible function.
Parameters:
Return Value:
Returns true if the objects match.
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:
Same as for base class.
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: THanNumberFormatter::TextToCanonicalNumber
virtual void TextToCanonicalNumber (const TText &, TCanonicalNumber &, TNumberScanResult &, const TTextRange &)
Interface Category:
API.
Purpose:
During a scanning operation, converts a text string into an instance of TCanonicalNumber. The scanning function then uses a TCanonicalNumberConverter to convert the canonical number to a binary number.
Calling Context:
Called by the Scan member function when converting a text string into a numeral.
Parameters:
- const TText & -Contains the text string to scan.
- TCanonicalNumber & -Receives the canonical number produced by the conversion.
- TNumberScanResult & -Receives information about the result of the scanning operation.
- const TTextRange & -Specifies the range of the text string to scan.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: THanNumberFormatter::CanonicalNumberToText
virtual void CanonicalNumberToText (const TCanonicalNumber &, TText &, TNumberFormatResult &)
Interface Category:
API.
Purpose:
During a formatting operation, converts an instance of TCanonicalNumber into a text string. The formatting function first uses a TCanonicalNumberConverter to convert the binary number into the canonical number.
Calling Context:
Called by the Format function when converting a numeral into a text string.
Parameters:
- const TCanonicalNumber & -Specifies the canonical number to convert.
- TText & -Receives the text string produced by the conversion.
- TNumberFormatResult & -Receives information about the result of the formatting operation.
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.