public abstract class DirEntry extends Object
Modifier and Type | Field and Description |
---|---|
static byte |
BITMASK_FILETYPE
BITMASK_FILETYPE.
|
static byte |
FILETYPE_DEL
FILETYPE_DEL.
|
static byte |
FILETYPE_PRG
FILETYPE_PRG.
|
static byte |
FILETYPE_REL
FILETYPE_REL.
|
static byte |
FILETYPE_SEQ
FILETYPE_SEQ.
|
static byte |
FILETYPE_USR
FILETYPE_USR.
|
Constructor and Description |
---|
DirEntry(int nrSectors,
byte[] fn,
byte fType)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
asciiTopetscii(String str,
int maxLen)
Convert ASCII string to PETSCII bytes.
|
static String |
convertFilename(byte[] fileName,
int fileType)
Quoted file name and type string.
|
String |
getValidFilename()
Return a valid filename to save this directory entry to hard disk.
|
abstract void |
save(File autostartFile)
Save the program of this directory entry to the specified file.
|
String |
toString()
Get string representation of this directory entry.
|
public static final byte BITMASK_FILETYPE
public static final byte FILETYPE_DEL
public static final byte FILETYPE_SEQ
public static final byte FILETYPE_PRG
public static final byte FILETYPE_USR
public static final byte FILETYPE_REL
public DirEntry(int nrSectors, byte[] fn, byte fType)
nrSectors
- disk: blocks used, tape: program lengthfn
- file namefType
- file type or -1 (no extension)public static final String convertFilename(byte[] fileName, int fileType)
fileName
- file namefileType
- file typepublic static final byte[] asciiTopetscii(String str, int maxLen)
str
- string to convertmaxLen
- maximum string length to take into accountpublic String toString()
public final String getValidFilename()
public abstract void save(File autostartFile) throws IOException
autostartFile
- file to saveIOException
- File write errorCopyright © 2018 Ken Händel. All rights reserved.