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.
- TForeignFileExtension (const TFile & existingFile)
- TForeignFileExtension (const TText & extension)
- TForeignFileExtension (const TForeignFileExtension &)
- TForeignFileExtension ()
Interface Category:
API.
Purpose:
- Creates a TForeignFileExtension by copying the extension of an existing file.
- Creates a TForeignFileExtension from the specified text.
- Copy constructor.
- Default constructor. Does not initialize member data.
Calling Context:
- Creates a TForeignFileExtension by copying the extension of an existing file.
- Creates a TForeignFileExtension from the specified text.
- Called to copy an object.
- Called by the stream-in operators.
Parameters:
- const TFile & existingFile -File whose extension is used to initialize this object.
- const TText & extension -The extension used to initialize this object.
- const TForeignFileExtension & -Object to copy.
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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.
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.
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.
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.
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:
- TText & fillin -The contents of this TText object are replaced with the text representation of this file extension.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
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.
TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -The stream to which this object's data is written.
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.
TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -The stream from which the object's data is read.
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.