Class: MOpenFile

Declaration: FileSystemInterface.h

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:

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:

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:

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:

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:

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:

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: MOpenFile::~MOpenFile

~ 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:

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.

Member Function: MOpenFile::MOpenFile

  1. MOpenFile (const MOpenFile & copy)
  2. MOpenFile (const TFile & file, EPermissionsForMe forMe, EPermissionsForOthers forOthers, bool deleteOnClose =false)
  3. MOpenFile ()

Interface Category:

API.

Purpose:

  1. Copy constructor.
  2. Specifies the file permissions for self and others, and delete on close options.
  3. Default constructor.

Calling Context:

  1. Called to copy an object.
  2. Most common constructor.
  3. Called by the stream-in operators and directly.

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.