|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webcodepro.applecommander.storage.filters.PascalTextFileFilter
public class PascalTextFileFilter
Filter the given file as a Pascal ".text" file.
From the Apple Pascal v1.2 Operating System Reference manual:
Following the initial header page, the text itself appears in
subsequent 1024-byte text pages (two block each, on diskette),
where a text page is defined:
Text files in Apple Pascal
(Thanks to Hans Otten for sending in this information.)
At the beginning of each textfile is a 1024-byte (two blocks on
diskette) header page, which contains information for the texteditor.
This space is reserved for use by the text editor, and is respected
by all portions of the system. When a user program opens a text file,
and REWRITEs or RESETs it with a title ending in .TEXT, the I/O
subsystem will create and skip over the initial header page. This is
done to faciliatie users editing their input and/or output data. The
file-handler wil transfer the header page only on a disk-to-disk
transfer, and will omit it on a transfer to a serial device (thus
transfers to PRINTER: abd CONSOLE: will omit the header page).
[DLE] [indent] [text] [cr] [dle] [indent] [text] [CR] .. [nulls]
DLE's (Data Link Escapes) are followed by an indent-code, which is a
byte containing the value 32+(number to indent). The nulls at the
end of the page follow a [CR} in all cases, and are a pad to the end
of a 1024-byte page (because the compiler wants integral numbers of
lines on a page). The Data Link Escape and corresponding indentation
code are optional. In a given text file, some lines will have the
codes, and some won't.
Constructor Summary | |
---|---|
PascalTextFileFilter()
Constructor for PascalTextFileFilter. |
Method Summary | |
---|---|
byte[] |
filter(FileEntry fileEntry)
Process the given FileEntry and return a byte array with filtered data; use PrintWriter to get platform agnostic line endings. |
java.lang.String |
getSuggestedFileName(FileEntry fileEntry)
Give suggested file name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PascalTextFileFilter()
Method Detail |
---|
public byte[] filter(FileEntry fileEntry)
filter
in interface FileFilter
public java.lang.String getSuggestedFileName(FileEntry fileEntry)
getSuggestedFileName
in interface FileFilter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |