void Abort( void )
-
Closes the file. It will not throw any exceptions.
void Close( void )
-
This closes the file.
Like CFile, it will throw a CFileException if there is a problem.
void Dump( CDumpContext& dump_context ) const
-
Will dump the contents of this object in human readable form.
It is present only in debug builds of the class.
CFile64 * Duplicate( void ) const
-
Will duplicate the handle to the file and return a new CFile64
object to you.
Like CFile, it will throw a CFileException if there is a problem.
void Flush( void )
-
Flushes the data to the disk.
Like CFile, it will throw a CFileException if there is a problem.
DWORD GetAttributes( void ) const
-
Retrieves the attributes used in the wrapped CreateFile() API. This value is used in
the sixth parameter to CreateFile(). This method is called by the
Open method. The default value is FILE_ATTRIBUTE_NORMAL.
CString GetFileName( void ) const
-
Returns the name of the file that is open.
CString GetFilePath( void ) const
-
Returns the complete path of the file that is open.
CString GetFileTitle( void ) const
-
Returns the title of the file. This is usually the filename without
the path or extension.
BOOL GetInformation( BY_HANDLE_FILE_INFORMATION& information ) const
-
Gives you all kinds of neat information about an open file.
ULONGLONG GetLength( void ) const
-
Returns the length of the file. It will return zero if it fails.
ULONGLONG GetPosition( void ) const
-
Returns the current position in the file of the file pointer.
Like CFile, it will throw a CFileException if there is a problem.
SECURITY_ATTRIBUTES * GetSecurityAttributes( void ) const
-
Returns the pointer to the security attributes for this file.
SECURITY_DESCRIPTOR * GetSecurityDescriptor( void ) const
-
Returns the pointer to the security descriptor for this file.
BOOL GetStatus( CFileStatus& status ) const
static BOOL PASCAL GetStatus)( LPCTSTR filename, CFileStatus& status )
-
Will fill
status with information about the file.
HANDLE GetTemplateFile( void ) const
-
Retrieves the handle to the file that will be used as a template in the
Open method. This handle is used as the seventh parameter
to the wrapped CreateFile() API.
void LockRange( ULONGLONG position, ULONGLONG number_of_bytes_to_lock )
-
Locks the range of bytes in the file.
Like CFile, it will throw a CFileException if there is a problem.
BOOL Open( LPCTSTR filename, UINT open_flags, CFileException * exception_p = NULL )
-
Opens the file. Read CFile's documentation for the
open_flags documentation.
DWORD Read( void * buffer, DWORD number_of_bytes_to_read )
DWORD Read( CByteArray& buffer, DWORD number_of_bytes_to_read )
-
Reads data from the file. It will return the number of bytes read.
Like CFile, it will throw a CFileException if there is a problem.
DWORD ReadHuge( void * buffer, DWORD number_of_bytes_to_read )
-
Simpy calls Read().
static void PASCAL Rename( LPCTSTR old_name, LPCTSTR new_name )
-
Renames a file.
Like CFile, it will throw a CFileException if there is a problem.
static void PASCAL Remove( LPCTSTR old_name, LPCTSTR new_name )
-
Renames a file.
Like CFile, it will throw a CFileException if there is a problem.
ULONGLONG Seek( ULONGLONG offset, UINT from )
-
Seeks to a position in a file.
Like CFile, it will throw a CFileException if there is a problem.
void SeekToBegin( void )
-
Seeks to the beginning of the file.
ULONGLONG SeekToEnd( void )
-
Seeks to the end of the file.
void SetAttributes( DWORD attributes )
-
Sets the attributes used in the wrapped CreateFile() API. This value is used in
the sixth parameter to CreateFile().
BOOL SetEndOfFile( ULONGLONG length )
-
Sets the end of the file at the specified location.
void SetFilePath( LPCTSTR new_name )
-
Sets the file name.
void SetLength( ULONGLONG new_length )
-
Sets the end of the file at the specified location.
Like CFile, it will throw a CFileException if there is a problem.
static void PASCAL SetStatus( LPCTSTR filename, const CFileStatus& status )
-
Basically calls CFile's implementation of this function.
void SetTemplateFile( HANDLE template_file_handle )
-
Sets the handle to the file that will be used as a template in the
Open method. This handle is used as the seventh parameter
to the wrapped CreateFile() API.
void UnlockRange( ULONGLONG position, ULONGLONG number_of_bytes_to_lock )
-
Unlocks a range of bytes in a file.
Like CFile, it will throw a CFileException if there is a problem.
void Write( const void * buffer, DWORD number_of_bytes )
-
Writes the bytes to the file.
Like CFile, it will throw a CFileException if there is a problem.
void WriteHuge( const void * buffer, DWORD number_of_bytes )
-
Writes the bytes to the file.