Package drivers.nxfa

Interface XfaFileheader

All Known Implementing Classes:
NfaFileheader, QemuFileheader, SfaFileheader

public interface XfaFileheader
The interface with required methods a fileheader object must have.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    flushHeader(FileChannel inoutChannel, boolean setDate)
    Writes the header to the native file.
    int
    Gets the dataspace.
    int
    getDate(int whatDate)
    Gets the date of the file from the header.
    int
    This gets the offset from file position 0, as SMSQE thinks it is and the real fileposition 0 in the native filesystem.
    Gets the (SMSQE) filename from the header.
    int
    Gets the version of the file from the header.
    boolean
    True if file should be an executable file.
    int
    readFileheader(MC68000Cpu cpu, int position, int bufflen)
    Reads the file header into the CPU's memory.
    void
    setDate(int whatDate, int dateToSet)
    Sets the date in the header.
    void
    Sets dates of files, if necessary.
    void
    Sets the (SMSQE) filename in the header.
    void
    setVersion(int version)
    Sets the version in the header.
    int
    writeFileHeader(MC68000Cpu cpu, int position)
    Writes the first 14 bytes of the fileheader from SMSQE to the file.
  • Method Details

    • readFileheader

      int readFileheader(MC68000Cpu cpu, int position, int bufflen)
      Reads the file header into the CPU's memory.
      Parameters:
      cpu - the cpu with the memory.
      position - where in that memory to put it.
      bufflen - length of that buffer.
      Returns:
      number of bytes read.
    • writeFileHeader

      int writeFileHeader(MC68000Cpu cpu, int position)
      Writes the first 14 bytes of the fileheader from SMSQE to the file.
      Parameters:
      cpu - the cpu with the memory.
      position - start address of file header in that buffer.
      Returns:
      number of bytes written.
    • getOffset

      int getOffset()
      This gets the offset from file position 0, as SMSQE thinks it is and the real fileposition 0 in the native filesystem.

      For example, the SFA driver uses Types.QFAHeaderLength (=68 at the time of writing) bytes at the beginning of the file for a header.

      Returns:
      the offset.
    • flushHeader

      boolean flushHeader(FileChannel inoutChannel, boolean setDate)
      Writes the header to the native file.
      Parameters:
      inoutChannel - the file channel to write to.
      setDate - = true if the date should be set to that of the channel's closing.
      Returns:
      true if the file dates should be set after closing the file
    • getSMSQEFilename

      String getSMSQEFilename()
      Gets the (SMSQE) filename from the header.
      Returns:
      the filename.
    • setSMSQEFilename

      void setSMSQEFilename(String name)
      Sets the (SMSQE) filename in the header.
      Parameters:
      name - the new name to set in the header.
    • getDate

      int getDate(int whatDate)
      Gets the date of the file from the header.
      Parameters:
      whatDate - what date do we want : 0 update date 2 : backup date
      Returns:
      the date of the file in smsqe format (date and time in seconds as of 1.1.1961).
    • setDate

      void setDate(int whatDate, int dateToSet)
      Sets the date in the header.
      Parameters:
      whatDate - what date do we want : 0 update date 2 : backup date
      dateToSet - the date to set as an SMSQE date (date and time in seconds as of 1.1.1961).
    • getVersion

      int getVersion()
      Gets the version of the file from the header.
      Returns:
      the file version
    • setVersion

      void setVersion(int version)
      Sets the version in the header.
      Parameters:
      version - the dversio to set
    • setFileDates

      void setFileDates(File f)
      Sets dates of files, if necessary.
      Parameters:
      f - the file in question
    • isExecutable

      boolean isExecutable()
      True if file should be an executable file.
      Returns:
      True if file should be an executable file.
    • getDataSpace

      int getDataSpace()
      Gets the dataspace.
      Returns:
      the dataspace if any, or 0 if none.