Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TFloatingPointNumberFormatter
Inherited By:
None.
Purpose:
This class, a special derived class of TFloatingPointNumberFormat, has a universal range, meaning that it can format any number including infinity and NaNs. This class is used as the default out-of-bounds number formatter for all other number formatters.
Instantiation:
Always allocate on the heap.
Deriving Classes:
Derived classes must override the TextToCanonicalNumber and CanonicalNumberToText functions.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TUniversalNumberFormatter ()
- TUniversalNumberFormatter (const TUniversalNumberFormatter & format)
Interface Category:
API.
Purpose:
- Default constructor. Creates a number formatter with an infinite range.
- Copy constructor.
Calling Context:
- Called by the stream-in operators and directly to instantiate this class.
- Called to copy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TUniversalNumberFormatter ()
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 void TextToCanonicalNumber (const TText &, TCanonicalNumber &, TNumberScanResult &, const TTextRange &)
Interface Category:
API.
Purpose:
During a scanning operation, converts a text string into a TCanonicalNumber object. 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.
virtual void CanonicalNumberToText (const TCanonicalNumber &, TText &, TNumberFormatResult &)
Interface Category:
API.
Purpose:
During a formatting operation, converts a TCanonicalNumber object 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.
TUniversalNumberFormatter & operator =(const TUniversalNumberFormatter &)
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 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 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 a TStandardException if the version of the formatter cannot be used on the current system.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual bool IsValidNumber (double) const
Interface Category:
API.
Purpose:
Queries whether a number is in the range of this formatter. This function always returns true.
Calling Context:
Called during conversion operations.
Parameters:
- double -The number to query about.
Return Value:
Returns true.
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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.