Back to the WFC main page

CTape : CDummyFile

$Revision: 28 $

Description

This class wraps the Tape API of Win32.

Data Members

None.

Methods

void Close( void )
Closes the tape drive. Basically calls Prepare( UnloadTape ).
BOOL CreatePartition( const TypeOfPartition type_of_partition,
                      const DWORD number_of_partitions,
                      const DWORD number_of_megabytes_in_each_partition )
Creates a tape partition. type_of_partition can be one of the following:
  • Fixed
  • Initiator
  • Select
BOOL Erase( const TypeOfErasure type_of_erasure, const BOOL return_immediately = FALSE )
Erases the tape. type_of_erasure can be one of the following:
  • Long
  • Short
DWORD GetDriveNumber( void ) const
Retrieves the drive number of an opened tape.
BOOL GetParameters( CTapeGetDriveParameters& parameters )
BOOL GetParameters( CTapeGetMediaParameters& parameters )
Retrieves either drive parameters or media parameters.
BOOL GetPosition( const Position type_of_position_to_get,
                  DWORD& partition_number,
                  DWORD& position_low,
                  DWORD& position_high )
Retrieves the postion of the tape. type_of_position_to_get can be one of the following:
  • Absolute
  • Logical
DWORD GetStatus( void ) const
Retrieves the status of the tape.
BOOL Load( void )
Loads a tape.
BOOL Lock( void )
Locks the tape into place.
BOOL Mark( const TypeOfMark type_of_mark, 
           const DWORD      number_of_marks_to_write, 
           const BOOL       return_immediately = FALSE )
Makes tape marks. type_of_mark can be one of the following:
  • File
  • LongFile
  • Set
  • ShortFile
BOOL Open( const UINT tape_drive_number_starting_at_zero = 0 )
Opens the tape drive number you specify.
BOOL Prepare( const Operation what_to_do, const BOOL return_immediately = FALSE )
Prepares a tape for reading/writing. what_to_do can be one of the following:
  • FormatTape
  • LoadTape
  • LockTape
  • TensionTape
  • UnloadTape
  • UnlockTape
BOOL Read( LPBYTE      buffer, 
           const DWORD number_of_bytes_to_read,
           LPDWORD     number_of_bytes_read,
           BOOL        abort = FALSE,
           BOOL        restore_security_data = TRUE )
Reads data from the tape.
BOOL Seek( const DWORD seek_low,
           const DWORD seek_high,
           LPDWORD seeked_low,
           LPDWORD seeked_high )
Repositions the tape for reading/writing.
BOOL SetAutomaticallyClose( BOOL automatically_close )
When this is set to TRUE, the tape drive will be closed when the destructor is called. It returns the previous setting.
BOOL SetParameters( const CTapeSetDriveParameters& parameters )
BOOL SetParameters( cosnt CTapeSetMediaParameters& parameters )
Sets either the drive or media parameters.
BOOL SetPosition( const PositionMethod how_to_get_there, 
                  const DWORD          partition_number,
                  const DWORD          position_low,
                  const DWORD          position_high,
                  const BOOL           return_immediately = FALSE )
Repositions the tape for reading/writing. how_to_get_there can be one of the following:
  • AbsoluteBlock
  • LogicalBlock
  • Rewind
  • EndOfData
  • FileMarks
  • RelativeBlocks
  • SequentialFileMarks
  • SequentialSetMarks
  • SetMarks
BOOL Unload( void )
Ejects the tape.
BOOL Unlock( void )
Unlocks the locking mechanism.
BOOL Write( LPBYTE      buffer,
            const DWORD number_of_bytes_to_write,
            LPDWORD     number_of_bytes_written,
            BOOL        abort = FALSE,
            BOOL        restore_security_data = TRUE )
Writes data to the tape.

Example

Sorry.

API's Used

CTape uses the following API's:
Copyright, 2000, Samuel R. Blackburn
$Workfile: ctape.cpp $
$Modtime: 1/04/00 5:24a $