Class: TNumberFormatResult

Declaration: NumberFormat.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TFormatResult

Inherited By:

None.

Purpose:

This class, derived from TFormatResult, contains information about the result of formatting a binary numeric value into a text string.

Instantiation:

Always allocate on the heap.

Deriving Classes:

This class is not designed to be derived.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TNumberFormatResult::TNumberFormatResult

  1. TNumberFormatResult ()
  2. TNumberFormatResult (const TNumberFormatResult & copy)

Interface Category:

API.

Purpose:

  1. Default constructor. Resets the error fields, sets the integer boundary to 0, and sets the digit sequence end to 0.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and directly to instantiate this class.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::~TNumberFormatResult

virtual ~ TNumberFormatResult ()

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: TNumberFormatResult::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: TNumberFormatResult::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 a TStandardException if the version of the formatter cannot be used on the current system.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::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: TNumberFormatResult::ResetErrors

virtual void ResetErrors ()

Interface Category:

API.

Purpose:

Resets all of the error information.

Calling Context:

Called when the object is constructed. Also called directly to reset the result fields.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::GetOutOfBoundsError

virtual bool GetOutOfBoundsError () const

Interface Category:

API.

Purpose:

Queries whether the number was out of the range of the number formatter. If this flag is set, the default out-of-bounds number formatter was used.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the number was out of the range of the number formatter.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::GetCanNormalize

virtual bool GetCanNormalize () const

Interface Category:

API.

Purpose:

Queries whether the string can be normalized.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the string can be normalized.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::GetIntegerBoundary

virtual unsigned long GetIntegerBoundary () const

Interface Category:

API.

Purpose:

Gets the index of the integer boundary (the separation point between the integer and fractional parts of the number).

Calling Context:

Call this function directly.

Parameters:

Return Value:

An unsigned long representing the index of the integer boundary within the formatted text.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::GetDigitSequenceEnd

virtual unsigned long GetDigitSequenceEnd () const

Interface Category:

API.

Purpose:

Gets the index of the digit sequence end (the position within the text string where the number ends and any surrounding text data begins).

Calling Context:

Call this function directly.

Parameters:

Return Value:

An unsigned long representing the index of the digit sequence end within the formatted text.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::SetOutOfBoundsError

virtual void SetOutOfBoundsError (bool)

Interface Category:

API.

Purpose:

Sets the out-of-bounds error flag if the number was out of the bounds of the number formatter. If this error occurs, the default out-of-bounds number formatter is used.

Calling Context:

Called during the formatting operation if this error occurred.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::SetCanNormalize

virtual void SetCanNormalize (bool)

Interface Category:

API.

Purpose:

Sets the can normalize flag if the string can be normalized.

Calling Context:

Called during the formatting operation if the string can be normalized.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::SetIntegerBoundary

virtual void SetIntegerBoundary (const unsigned long)

Interface Category:

API.

Purpose:

Sets the index of the integer boundary (the separation point between the integer part of the value and the fractional part of the value).

Calling Context:

Called during the formatting operation.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::SetDigitSequenceEnd

virtual void SetDigitSequenceEnd (const unsigned long)

Interface Category:

API.

Purpose:

Sets the index of the digit sequence end (the position in the text string where the number ends and any surrounding text begins).

Calling Context:

Called during the formatting operation.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberFormatResult::operator=

  1. virtual TFormatResult & operator =(const TFormatResult &)
  2. virtual TNumberFormatResult & operator =(const TNumberFormatResult &)

Interface Category:

API.

Purpose:

  1. Inherited assignment operator from class TFormatResult.
  2. Assignment operator.

Calling Context:

  1. Called when a TFormatResult object is polymorphically assigned to another TNumberFormatResult object.
  2. Called when an object is assigned to another compatible object.

Parameters:

Return Value:

  1. Returns a TFormatResult reference to this number format result object.
  2. Returns a TNumberFormatResult reference to this number format result object.

Exceptions:

Throws the exception TFormatterException::kIncorrectScanOrFormatResultProvided if an incorrect format result is provided.

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.