![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TDateTimeFormatter
Inherited By:
TGregorianDateTimeFormatter
Purpose:
Derived from TDateTimeFormatter, this class provides the abstract protocol for date/time formatters that use patterns for scanning and formatting. The pattern is specified using a set of TFormatter objects.
Instantiation:
Abstract class; do not allocate.
Deriving Classes:
Derived classes of TPatternBasedDateTimeFormatter must override the GetCalendar function to return the calendar used by the derived class.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
virtual ~ TPatternBasedDateTimeFormatter ()
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 AdoptPattern (TDateTimePattern * pattern, bool perfectPattern =true)
Interface Category:
API.
Purpose:
Adopts the TDateTimePattern used by this formatter.
Calling Context:
Called to attach a pattern to the formatter.
Parameters:
- TDateTimePattern * pattern -The pattern to adopt.
- bool perfectPattern =true -Whether this pattern is to be used for formatting and as the first choice for scanning.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void GetPattern (TDateTimePattern & pattern) const
Interface Category:
API.
Purpose:
Returns the TDateTimePattern for this formatter.
Calling Context:
Called to retrieve the pattern.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TPatternBasedDateTimeFormatter & operator =(const TPatternBasedDateTimeFormatter & format)
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 & 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 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.
- TPatternBasedDateTimeFormatter ()
- TPatternBasedDateTimeFormatter (const TPatternBasedDateTimeFormatter & format)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- 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 void TimeToText (TCalendar & calendar, TText & text, TFormatResult & result) const
Interface Category:
API.
Purpose:
Converts the time as represented in the calendar to a textual form. It also returns the format accuracy result.
Calling Context:
Called during the formatting operation.
Parameters:
- TCalendar & calendar -The calendar with the time to be formatted.
- TText & text -Receives the output text.
- TFormatResult & result -Receives the formatting accuracy result.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void TextToTime (const TText & text, const TTextRange & inputRange, TCalendar & calendar, TScanResult & result) const
Interface Category:
API.
Purpose:
Scans a text object and attempts to parse it into date/time information, setting the fields of a calendar accordingly. It also returns the scan accuracy result.
Calling Context:
Called during the scanning operation.
Parameters:
- const TText & text -The text to scan.
- const TTextRange & inputRange -The range of text to scan.
- TCalendar & calendar -The calendar whose fields are set according to the scanned values.
- TScanResult & result -Receives the scanning accuracy result.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TCalendar * GetCalendar () const
Interface Category:
API.
Purpose:
A given formatter only works in conjunction with a particular calendar. Hence, this pure virtual function is overridden by the derived class to provide an appropriate calendar.
Calling Context:
Called by Format and Scan.
Parameters:
Return Value:
Returns the appropriate TCalendar derived class.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetCalendar (const TCalendar & calendar)
Interface Category:
API.
Purpose:
Sets the calendar for the formatter.
Calling Context:
Called to set the calendar for the formatter.
Parameters:
- const TCalendar & calendar -The calendar to be used by the formatter.
Return Value:
None.
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.