public class NfaFileheader extends java.lang.Object implements XfaFileheader
Constructor and Description |
---|
NfaFileheader(java.io.File f,
java.lang.String filename,
int lengthIfDir)
Creates the object for an existing java.io.File.
|
Modifier and Type | Method and Description |
---|---|
boolean |
flushHeader(java.nio.channels.FileChannel inoutChannel,
boolean setDate)
Normally writes the header to disk, but here we don't flush the header at all!
|
int |
getDate(int whatDate)
Gets the date of the file from the header.
|
int |
getOffset()
Gets the header offset.
|
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 |
setLength(int length)
Sets the length of the file in the header.
|
void |
setSMSQEFilename(java.lang.String name)
Sets the (SMSQE) filename in the header - but does nothing here.
|
void |
setVersion(int version)
Sets the version in the header.
|
int |
writeFileHeader(MC68000Cpu cpu,
int position)
Writes the fileheader from SMSQE to the NFA - except that it doesn't...
|
public NfaFileheader(java.io.File f, java.lang.String filename, int lengthIfDir)
f
- the existing filefilename
- the smsqe filename for this file.lengthIfDir
- length of the file if it is a directory.public int readFileheader(MC68000Cpu cpu, int position, int bufflen)
readFileheader
in interface XfaFileheader
cpu
- the cpu with the memory.position
- where in that buffer to put it.bufflen
- (length of that buffer)= how many bytes to get (not more!).public int writeFileHeader(MC68000Cpu cpu, int position)
writeFileHeader
in interface XfaFileheader
cpu
- the cpu with the memory.position
- at what position to write to.public int getOffset()
getOffset
in interface XfaFileheader
XfaFileheader.getOffset()
public boolean flushHeader(java.nio.channels.FileChannel inoutChannel, boolean setDate)
flushHeader
in interface XfaFileheader
inoutChannel
- ignored.
#param setDate ignored.setDate
- = true if the date should be set to that of the channel's closing.public java.lang.String getSMSQEFilename()
getSMSQEFilename
in interface XfaFileheader
String
.public void setSMSQEFilename(java.lang.String name)
setSMSQEFilename
in interface XfaFileheader
name
- ignored.public int getDate(int whatDate)
getDate
in interface XfaFileheader
whatDate
- what date do we want : 0 update date 2 : backup date this is ignored here, both are always the samepublic void setDate(int whatDate, int dateToSet)
setDate
in interface XfaFileheader
whatDate
- what date do we want to set : 0 = update date 2 = backup datedateToSet
- the date to set as an SMSQE date (date and time in seconds as of 1.1.1961)..public int getVersion()
getVersion
in interface XfaFileheader
public void setVersion(int version)
setVersion
in interface XfaFileheader
version
- the version to setpublic void setLength(int length)
length
- the length to setpublic void setFileDates(java.io.File f)
XfaFileheader
setFileDates
in interface XfaFileheader
f
- the file in question