Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
None.
Inherited By:
TMappedFile
TFileStream
Purpose:
A mixin class that carries state information for open files.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Do not derive from this class.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Member Function: MOpenFile::GetFile
virtual TFile GetFile () const
Interface Category:
API.
Purpose:
Extracts the file for which this object holds open state.
Calling Context:
Call this function directly.
Parameters:
Return Value:
The file for this open state object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: MOpenFile::SetEndOfFile
virtual void SetEndOfFile (FileSystemEntitySize newSize)
Interface Category:
API.
Purpose:
Updates the logical end-of-file marker for this file.
Calling Context:
Call this function directly.
Parameters:
- FileSystemEntitySize newSize -The new end-of-file mark.
Return Value:
None.
Exceptions:
Throws TFileSystemObjectInvalid if the entity is uninitialized.
Throws TFileSystemEntityNotAvailable if the entity cannot be found.
Throws TFileSystemAccessDenied if the caller is not privileged to change the end-of-file.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: MOpenFile::GetEndOfFile
virtual FileSystemEntitySize GetEndOfFile () const
Interface Category:
API.
Purpose:
Extracts the current logical end-of-file marker.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the current end-of-file marker.
Exceptions:
Throws TFileSystemObjectInvalid if the entity is uninitialized.
Throws TFileSystemEntityNotAvailable if the entity cannot be found.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: MOpenFile::InitializeOpenFile
void InitializeOpenFile (const TFile & file, EPermissionsForMe forMe, EPermissionsForOthers forOthers, bool deleteOnClose =false)
Interface Category:
API.
Purpose:
Allows derived classes to preprocess any parameters by allowing initialization of this class after the constructor has executed.
Calling Context:
Called by derived classes only.
Parameters:
- const TFile & file -The file to open.
- EPermissionsForMe forMe -My access rights.
- EPermissionsForOthers forOthers -Others' access rights.
- bool deleteOnClose =false -A flag that determines if the file should be deleted on close.
Return Value:
None.
Exceptions:
Throws TFileSystemObjectInvalid if the entity is uninitialized.
Throws TFileSystemEntityNotAvailable if the entity cannot be found.
Throws TFileSystemAccessDenied if the caller is not privileged to open the file.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: MOpenFile::GetPermissions
virtual void GetPermissions (EPermissionsForMe & fillinMine, EPermissionsForOthers & fillinOthers) const
Interface Category:
API.
Purpose:
Finds out what kinds of access are allowed on this open file.
Calling Context:
Call this function directly.
Parameters:
- EPermissionsForMe & fillinMine -On return, contains my access rights.
- EPermissionsForOthers & fillinOthers -On return, contains others' access rights.
Return Value:
The current open file permissions.
Exceptions:
Throws TFileSystemObjectInvalid if the entity is uninitialized.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: MOpenFile::SetPermissions
virtual void SetPermissions (EPermissionsForMe forMe, EPermissionsForOthers forOthers)
Interface Category:
API.
Purpose:
Changes the access permissions on this open file.
Calling Context:
Call this function directly.
Parameters:
- EPermissionsForMe forMe -Set these access rights for me.
- EPermissionsForOthers forOthers -Set these access rights for others.
Return Value:
None.
Exceptions:
Throws TFileSystemObjectInvalid if the entity is uninitialized.
Throws TFileSystemEntityNotAvailable if the entity cannot be found.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: MOpenFile::operator<<=
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 streams itself 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.
Member Function: MOpenFile::operator>>=
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 streams itself 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.
~ MOpenFile ()
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:
If delete on close is true, and this is the last closer, the file on disk is deleted.
Member Function: MOpenFile::operator=
MOpenFile & operator =(const MOpenFile & copy)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const MOpenFile & copy -The open file object to copy.
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws TFileSystemObjectInvalid if the entity is uninitialized.
Concurrency:
Not multithread safe.
Other Considerations:
None.
- MOpenFile (const MOpenFile & copy)
- MOpenFile (const TFile & file, EPermissionsForMe forMe, EPermissionsForOthers forOthers, bool deleteOnClose =false)
- MOpenFile ()
Interface Category:
API.
Purpose:
- Copy constructor.
- Specifies the file permissions for self and others, and delete on close options.
- Default constructor.
Calling Context:
- Called to copy an object.
- Most common constructor.
- Called by the stream-in operators and directly.
Parameters:
- const MOpenFile & copy -The object to copy.
- const TFile & file -The file to open.
- EPermissionsForMe forMe -Access permissions for the caller.
- EPermissionsForOthers forOthers -Access permissions for subsequent openers of this file.
- bool deleteOnClose =false -Whether to delete file when closed.
- Takes no parameters.
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.