Class: TForeignFileExtension

Declaration: ForeignData.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TForeignDataType

Inherited By:

None.

Purpose:

TForeignFileExtension stores and allows comparison of file name extensions such as '.txt' and '.bmp'. Comparisons are not case-sensitive.

Instantiation:

Allocate on the heap or the stack. Safe to allocate at static constructor time. Safe to allocate in an alternate heap and in shared memory.

Deriving Classes:

TForeignFileExtension is intended to be used directly, without deriving. However, it is possible to derive new classes, as long as the TForeignFileExtension interface is preserved.

Concurrency:

Not multithread safe. The exceptions are the const member functions operator==, Hash, operator>>=, and GetExtension, which are multithread safe.

Resource Use:

No special requirements.

Member Function: TForeignFileExtension::TForeignFileExtension

  1. TForeignFileExtension (const TFile & existingFile)
  2. TForeignFileExtension (const TText & extension)
  3. TForeignFileExtension (const TForeignFileExtension &)
  4. TForeignFileExtension ()

Interface Category:

API.

Purpose:

  1. Creates a TForeignFileExtension by copying the extension of an existing file.
  2. Creates a TForeignFileExtension from the specified text.
  3. Copy constructor.
  4. Default constructor. Does not initialize member data.

Calling Context:

  1. Creates a TForeignFileExtension by copying the extension of an existing file.
  2. Creates a TForeignFileExtension from the specified text.
  3. Called to copy an object.
  4. Called by the stream-in operators.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TForeignFileExtension::~TForeignFileExtension

virtual ~ TForeignFileExtension ()

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

virtual bool operator ==(const TForeignDataType & other) const

Interface Category:

API.

Purpose:

Tests whether this object represents the same foreign data type as another object. This member function first checks to make sure the other object is a TForeignFileExtension and then performs a case-insensitive comparison of the extensions.

Calling Context:

Called when this object is on the left-hand side of the ==operator and any TForeignDataType is on the right-hand side.

Parameters:

Return Value:

Returns true if the other object is a TForeignFileExtension representing the same extension as this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TForeignFileExtension::operator!=

virtual bool operator != (const TForeignDataType & other) const

Interface Category:

API.

Purpose:

Tests whether this object represents the same foreign data type as another object. This member function first checks to make sure the other object is a TForeignFileExtension and then performs a case-insensitive comparison of the extensions.

Calling Context:

Called when this object is on the left-hand side of the ==operator and any TForeignDataType is on the right-hand side.

Parameters:

Return Value:

Returns false if the other object is a TForeignFileExtension representing the same extension as this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. The exceptions are.

Other Considerations:

None.

Member Function: TForeignFileExtension::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Returns a hash value computed from this file extension.

Calling Context:

This function is usually called indirectly by the TComparator for a collection of TForeignData objects. This function can also be called directly.

Parameters:

Return Value:

A long hash value computed from this extension.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TForeignFileExtension::GetExtension

void GetExtension (TText & fillin)

Interface Category:

API.

Purpose:

Retrieves a text representation of this file name extension.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TForeignFileExtension::operator=

TForeignFileExtension & operator =(const TForeignFileExtension & other)

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

TStream & operator >>=(TStream &) 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:

Multithread safe.

Other Considerations:

None.

Member Function: TForeignFileExtension::operator<<=

TStream & operator <<= (TStream &)

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 TInvalidVersionError if the data on the stream is an unrecognized version. 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.