Back to the WFC main page

CDummyFile : CFile

$Revision: 24 $

Description

This class intercepts all calls to functions in CFile that would blow up if what your file HANDLE doesn't point to a file on a disk drive (like a TCP/IP socket or the serial port). It also adds a couple of useful functions that should have been in CFile (IMHO).

Data Members

None.

Methods

void Abort( void )
Closes the file.
void Close( void )
Closes the file.
void Flush( void )
Flushes file buffers.
DWORD GetErrorCode( void ) const
Retrieves the error code if a function fails or returns FALSE.
DWORD GetLength( void ) const
Makes no sense if you don't have a disk file. It always returns zero.
DWORD GetPosition( void ) const
Makes no sense. Always returns zero.
BOOL GetStatus( CFileStatus& status )
BOOL GetStatus( LPCTSTR filename, CFileStatus& status )
Makes no sense.
void LockRange( DWORD position, DWORD count )
Makes no sense.
void Remove( LPCTSTR filename )
Makes no sense. Always returns FALSE.
void Rename( LPCTSTR old_filename, LPCTSTR new_filename )
Makes no sense.
LONG Seek( LONG offset, UINT from )
Makes no sense. Always returns zero.
void Serialize( CArchive& archive )
Saves/restores the object.
void SetLength( DWORD length )
Makes no sense.
void SetStatus( LPCTSTR name, CFileStatus& status )
Makes no sense.
void UnlockRange( DWORD position, DWORD count )
Makes no sense.
void Write( const CString& string_to_write )
void Write( const CByteArray& data_to_write )
Adds capability to write a CString or a CByteArray.

Example

Sorry.

Copyright, 2000, Samuel R. Blackburn
$Workfile: dumyfile.cpp $
$Modtime: 1/05/00 3:37a $