Class: TDateTimePattern

Declaration: DateTime.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TParameterFormatter

Inherited By:

None.

Purpose:

Derived from TParameterFormatter, this is a concrete class used by TPatternBasedDateTimeFormatter to format and scan. Typically, a date/time formatter would contain a perfect template used for formatting, and zero or more alternate templates that can be used in scanning. This class is primarily of interest to localizers rather than direct clients.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TDateTimePattern is a concrete class designed to be used directly and not be derived

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TDateTimePattern::TDateTimePattern

  1. TDateTimePattern ()
  2. TDateTimePattern (const TDateTimePattern &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  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: TDateTimePattern::~TDateTimePattern

virtual ~ TDateTimePattern ()

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: TDateTimePattern::SetDateTimeFieldFormat

virtual void SetDateTimeFieldFormat (const TTextRange & range, ParameterIndex parameterNumber, TCalendar :: DateTimeFieldType whichField, const TFormatter & formatter)

Interface Category:

API.

Purpose:

Associates a TFormatter with a date/time field and a range in the pattern. Because all date/time fields are numeric, the TFormatter must be one that can handle numbers. If this function is not called for a given parameter, it is formatted as an integer.

Calling Context:

Called directly when constructing a pattern.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDateTimePattern::operator=

TDateTimePattern & operator =(const TDateTimePattern & 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.

Member Function: TDateTimePattern::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: TDateTimePattern::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: TDateTimePattern::GetFieldForParameter

virtual TCalendar :: DateTimeFieldType GetFieldForParameter (ParameterIndex index)

Interface Category:

API.

Purpose:

Gets the type of the date time field in the date pattern, whether it is a YearInEra, MonthInYear, and so on.

Calling Context:

Called to get the field.

Parameters:

Return Value:

The type of date time field.

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.