Class: TNumberScanResult

Declaration: NumberFormat.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TScanResult

Inherited By:

None.

Purpose:

This class, derived from TScanResult, contains information about the result of scanning a text string and converting it to a number.

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: TNumberScanResult::TNumberScanResult

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

Interface Category:

API.

Purpose:

  1. Default constructor. Resets the error fields and sets the length scanned 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: TNumberScanResult::~TNumberScanResult

virtual ~ TNumberScanResult ()

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

virtual long Hash () const

Interface Category:

API. Not multithread safe.

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: TNumberScanResult::ParseDone

virtual void ParseDone (const TTextRange &, unsigned long lastIndex)

Interface Category:

API.

Purpose:

Sets the confidence of a parsing operation when the operation is finished.

Calling Context:

Called during the scanning operation.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberScanResult::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: TNumberScanResult::GetSeparatorError

virtual bool GetSeparatorError () const

Interface Category:

API.

Purpose:

Queries whether there was a separator error in the scanned text; that is, whether a digit group separator was incorrectly placed.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if there was a separator error in the scanned text.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberScanResult::GetIncompleteSign

virtual bool GetIncompleteSign () const

Interface Category:

API.

Purpose:

Queries whether there was an incomplete sign error in the scanned text; for example, if the negative prefix was attached to the text but the negative suffix was not attached.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if there was an incomplete sign error in the scanned text.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberScanResult::GetValueOrderError

virtual bool GetValueOrderError () const

Interface Category:

API.

Purpose:

Queries whether there was a value order error in the scanned text, for scanning using a numbering system sensitive to order, such as the Roman numbering system.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if there was a value order error in the scanned text.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberScanResult::GetOutOfBoundsError

virtual bool GetOutOfBoundsError () const

Interface Category:

API.

Purpose:

Queries whether the number was out of the range of the number formatter.

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: TNumberScanResult::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: TNumberScanResult::SetSeparatorError

virtual void SetSeparatorError (bool)

Interface Category:

API.

Purpose:

Sets the separator error flag if a separator error occurred.

Calling Context:

Called during the scanning operation if this type of error occurred.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberScanResult::SetIncompleteSign

virtual void SetIncompleteSign (bool)

Interface Category:

API.

Purpose:

Sets the incomplete sign flag if an incomplete sign error occurred.

Calling Context:

Called during the scanning operation if this type of error occurred.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberScanResult::SetValueOrderError

virtual void SetValueOrderError (bool)

Interface Category:

API.

Purpose:

Sets the value order error flag if a value order error occurred.

Calling Context:

Called during the scanning operation if this type of error occurred.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberScanResult::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 scanning operation if this type of error occurred.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TNumberScanResult::SetCanNormalize

virtual void SetCanNormalize (bool)

Interface Category:

API.

Purpose:

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

Calling Context:

Called during the scanning 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: TNumberScanResult::operator=

  1. virtual TScanResult & operator =(const TScanResult &)
  2. virtual TNumberScanResult & operator =(const TNumberScanResult &)

Interface Category:

API.

Purpose:

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

Calling Context:

  1. Called when a TScanResult object is polymorphically assigned to a TNumberScanResult object.
  2. Called when an object is assigned to another compatible object.

Parameters:

Return Value:

  1. Returns a TScanResult reference to this number scan result object.
  2. Returns a TNumberScanResult reference to this scan result object.

Exceptions:

Throws the exception TFormatterException::kIncorrectScanOrFormatResultProvided if incorrect scan 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.