Class: TSimpleTextFormatter

Declaration: TextFormatter.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TFormatter

Inherited By:

None.

Purpose:

Derived from TFormatter, this class allows you to include text parameters within TParameterFormatter objects. The Format function formats the text wrapped in a TFormattableText object into a TText object. The Scan function parses characters until it reaches the terminating string of the formatter, returning the text in a TFormattableText object.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This class is designed to be used directly.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TSimpleTextFormatter::~TSimpleTextFormatter

virtual ~ TSimpleTextFormatter ()

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

TSimpleTextFormatter & operator =(const TSimpleTextFormatter & toCopy)

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: TSimpleTextFormatter::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: TSimpleTextFormatter::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: TSimpleTextFormatter::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: TSimpleTextFormatter::Format

virtual void Format (const TFormattable & value, TText & text, TFormatResult & conversionResult) const

Interface Category:

API.

Purpose:

Given a TFormattableText object, formats its value into a text object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws an exception if the Formattable or format result arguments are not of the right type for this formatter.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextFormatter::Scan

virtual void Scan (const TText & text, const TTextRange & inputRange, TFormattable & value, TScanResult & conversionResult) const

Interface Category:

API.

Purpose:

Given a text string, scans the text until it reaches the terminating string, and returns the scanned text as a TFormattableText object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws an exception if the Formattable or scan result arguments are not of the right type for this formatter.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextFormatter::SetTerminatingText

virtual void SetTerminatingText (const TText & theString)

Interface Category:

API.

Purpose:

Specifies a terminating string for use when scanning in text. The scanning operation stops when it reaches this string. None of the terminating string is scanned into the result.

Calling Context:

Called to specify a terminating string for this formatter after construction.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextFormatter::GetTerminatingText

virtual const TText * GetTerminatingText () const

Interface Category:

API.

Purpose:

Returns the terminating string for this formatter.

Calling Context:

Called by the scanning operation to get the terminating string.

Parameters:

Return Value:

The terminating string for this formatter.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextFormatter::CreateFormattable

virtual TFormattable * CreateFormattable () const

Interface Category:

API.

Purpose:

Creates the Formattable, TFormattableText, used for this formatter.

Calling Context:

Called by the Scan function.

Parameters:

Return Value:

Returns a TFormattableText object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextFormatter::CreateScanResult

virtual TScanResult * CreateScanResult () const

Interface Category:

API.

Purpose:

Creates the scanning accuracy result object, TScanResult, used by this formatter.

Calling Context:

Called by the Scan function.

Parameters:

Return Value:

Returns a TScanResult object. The caller owns the storage.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextFormatter::CreateFormatResult

virtual TFormatResult * CreateFormatResult () const

Interface Category:

API.

Purpose:

Creates the formatting accuracy result object, TFormatResult, used by this formatter.

Calling Context:

Called by the Format function.

Parameters:

Return Value:

Returns a TFormatResult object. The caller owns the storage.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextFormatter::TSimpleTextFormatter

  1. TSimpleTextFormatter ()
  2. TSimpleTextFormatter (const TText & terminatingText)
  3. TSimpleTextFormatter (const TText & terminatingText, TTextOrder * textOrderToAdopt)
  4. TSimpleTextFormatter (const TSimpleTextFormatter & toCopy)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Constructor which takes a terminating text.
  3. Constructor which takes a terminating text, and a pointer to the text order which is used for pattern matching.
  4. Copy constructor.

Calling Context:

  1. Called by the stream-in operators or to construct a default TSimpleTextFormatter.
  2. Called to construct a TSimpleTextFormatter with a specified terminating text.
  3. Called to construct a TSimpleTextFormatter with a specified terminating text, and a pointer to the text order to be used for pattern matching.
  4. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:


Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.