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.
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.
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.
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.
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 no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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:
- const TFormattable & value -The Formattable object to format.
- TText & text -Receives the formatted text.
- TFormatResult & conversionResult -Receives information about the accuracy of the formatting operation.
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.
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:
- const TText & text -The text to scan.
- const TTextRange & inputRange -The range of text to scan.
- TFormattable & value -Receives the scanned in value.
- TScanResult & conversionResult -Receives information about the accuracy of the scanning operation.
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.
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:
- const TText & theString -The terminating string for this formatter.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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.
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.
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.
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.
- TSimpleTextFormatter ()
- TSimpleTextFormatter (const TText & terminatingText)
- TSimpleTextFormatter (const TText & terminatingText, TTextOrder * textOrderToAdopt)
- TSimpleTextFormatter (const TSimpleTextFormatter & toCopy)
Interface Category:
API.
Purpose:
- Default constructor.
- Constructor which takes a terminating text.
- Constructor which takes a terminating text, and a pointer to the text order which is used for pattern matching.
- Copy constructor.
Calling Context:
- Called by the stream-in operators or to construct a default TSimpleTextFormatter.
- Called to construct a TSimpleTextFormatter with a specified terminating text.
- Called to construct a TSimpleTextFormatter with a specified terminating text, and a pointer to the text order to be used for pattern matching.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TText & terminatingText -text which is used during scanning. TSimpleTextFormatter::Scan function scans a specified range of a text instance until it reaches the terminating text.
- const TText & terminatingText -text which is used during scanning. TSimpleTextFormatter::Scan function scans a specified range of a text instance until it reaches the terminating text.
- TTextOrder * textOrderToAdopt -a pointer to the text order to be used for pattern matching.
- const TSimpleTextFormatter & toCopy -the copy of TSimpleTextFormatter to be copied.
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.