public class QemuFileheader extends java.lang.Object implements XfaFileheader
Constructor and Description |
---|
QemuFileheader(java.io.File f,
java.lang.String filename,
java.nio.channels.FileChannel inoutChannel)
Creates the object either from an existing
java.io.File , or a newly created one. |
Modifier and Type | Method and Description |
---|---|
boolean |
flushHeader(java.nio.channels.FileChannel inoutChannel,
boolean setDate)
Actually writes the header to the file.
!!!!
|
int |
getDate(int whatDate)
Gets the date of the file from the header.
|
int |
getOffset()
Gets the header offset -offset from beginning of native file to beginning of QL file
|
java.lang.String |
getSMSQEFilename()
Gets the (SMSQE) filename from the header.
|
int |
getVersion()
Gets the version of the file from the header.
|
int |
readFileheader(MC68000Cpu cpu,
int position,
int bufflen)
"Reads" the file header into the SMSQE buffer.
|
void |
setDate(int whatDate,
int dateToSet)
Sets the date in the header.
|
void |
setFileDates(java.io.File f)
Sets dates of files, if necessary.
|
void |
setSMSQEFilename(java.lang.String filename)
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 SFA header.
|
public QemuFileheader(java.io.File f, java.lang.String filename, java.nio.channels.FileChannel inoutChannel) throws java.io.IOException
java.io.File
, or a newly created one.f
- the file.filename
- the filename.inoutChannel
- a channel for reading the existing header.java.io.IOException
- from java io operations.public int readFileheader(MC68000Cpu cpu, int position, int bufflen)
readFileheader
in interface XfaFileheader
cpu
- the cpu with the memory.position
- where in that memory the header should be written.bufflen
- how many bytes to write.XfaFileheader.readFileheader(smsqmulator.cpu.MC68000Cpu, int, int)
public int writeFileHeader(MC68000Cpu cpu, int position)
writeFileHeader
in interface XfaFileheader
cpu
- the cpu with the memory from where to read the header.position
- the mem position in smsqe's memory map.XfaFileheader.writeFileHeader(smsqmulator.cpu.MC68000Cpu, int)
public boolean flushHeader(java.nio.channels.FileChannel inoutChannel, boolean setDate)
flushHeader
in interface XfaFileheader
inoutChannel
- The channel to write to.setDate
- = true if the date should be set to that of the channel's closing.public int getOffset()
getOffset
in interface XfaFileheader
XfaFileheader.getOffset()
public java.lang.String getSMSQEFilename()
getSMSQEFilename
in interface XfaFileheader
String
.public void setSMSQEFilename(java.lang.String filename)
setSMSQEFilename
in interface XfaFileheader
filename
- the name to set.public int getDate(int whatDate)
getDate
in interface XfaFileheader
whatDate
- what date do we want : 0 update date 2 : backup datepublic void setDate(int whatDate, int dateToSet)
setDate
in interface XfaFileheader
whatDate
- what date do we want : 0 update date 2 : backup datedateToSet
- the date to set as an SMSQE date (date and time in seconds as of 1.1.1961)..
Contrary to the normal documentation, this will NOT set the backup date for a read only file!!!!!!!!!!public int getVersion()
getVersion
in interface XfaFileheader
public void setVersion(int version)
setVersion
in interface XfaFileheader
version
- the version (a word) to set.public void setFileDates(java.io.File f)
XfaFileheader
setFileDates
in interface XfaFileheader
f
- the file in question