|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttcl.lang.TclIO
public class TclIO
Field Summary | |
---|---|
static int |
APPEND
Append to end of file when writing |
static int |
BUFF_FULL
Do full buffering up to size of buffer |
static int |
BUFF_LINE
Flush at end of line; buffer only one line on input |
static int |
BUFF_NONE
Flush after every write; don't buffer any input |
static int |
CREAT
Create a new file |
static int |
EXCL
|
static int |
RDONLY
Open read-only |
static int |
RDWR
Open for reading and writing |
static int |
READ_ALL
Read all available input, until EOF |
static int |
READ_LINE
Read up to end of line |
static int |
READ_N_BYTES
Read a specified number of bytes |
static int |
SEEK_CUR
Seek relative to the current position in the file |
static int |
SEEK_END
Seek relative to the end of the file |
static int |
SEEK_SET
Seek relative to the beginning of the file |
static int |
TRANS_AUTO
Translate \n, \r, \r\n to \n on input; translate \n to platform-specific end of line on output |
static int |
TRANS_BINARY
Don't translate end of line characters |
static int |
TRANS_CR
\n -> \r on output; \r -> \n on input |
static int |
TRANS_CRLF
\n to \r\n on output; \r\n -> \n on input |
static int |
TRANS_LF
Don't translate end of line characters |
static int |
TRANS_PLATFORM
End-of-line translation for the current platform |
static int |
TRUNC
|
static int |
WRONLY
Open write-only |
Constructor Summary | |
---|---|
TclIO()
|
Method Summary | |
---|---|
static void |
flushAllOpenChannels(Interp interp)
Call flush() for each currently registered open channel, ignoring exceptions. |
static int |
getBufferingID(String buffering)
|
static String |
getBufferingString(int buffering)
|
static Channel |
getChannel(Interp interp,
String chanName)
Return a registered Channel object, given its name. |
static void |
getChannelNames(Interp interp,
TclObject pattern)
Put all the channel names into the interpreter's result, as a list |
static String |
getNextDescriptor(Interp interp,
String prefix)
Given a prefix for a channel name (such as "file") returns the next available channel name (such as "file5"). |
static Channel |
getStdChannel(int type)
|
static int |
getTranslationID(String translation)
|
static String |
getTranslationString(int translation)
|
static void |
giveChannel(Interp master,
Interp slave,
String chanName,
boolean removeFromMaster)
Give a channel to another interpreter, in exactly the same form it exists in the master |
static void |
registerChannel(Interp interp,
Channel chan)
Register a channel in this interpreter's channel table. |
static void |
unregisterChannel(Interp interp,
Channel chan)
Unregister a channel and it's FileEventScripts in this interpreter's channel table, and call close() on that channel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int READ_ALL
public static final int READ_LINE
public static final int READ_N_BYTES
public static final int SEEK_SET
public static final int SEEK_CUR
public static final int SEEK_END
public static final int RDONLY
public static final int WRONLY
public static final int RDWR
public static final int APPEND
public static final int CREAT
public static final int EXCL
public static final int TRUNC
public static final int BUFF_FULL
public static final int BUFF_LINE
public static final int BUFF_NONE
public static final int TRANS_AUTO
public static final int TRANS_BINARY
public static final int TRANS_LF
public static final int TRANS_CR
public static final int TRANS_CRLF
public static int TRANS_PLATFORM
Constructor Detail |
---|
public TclIO()
Method Detail |
---|
public static Channel getChannel(Interp interp, String chanName)
interp
- Interpreter contextchanName
- Name of channel
public static void getChannelNames(Interp interp, TclObject pattern) throws TclException
interp
- this interpreterpattern
- Return only channel names that match this patter, as in
'string match', can be null to match all channels
TclException
public static void registerChannel(Interp interp, Channel chan)
interp
- This interpreterchan
- channel to registerpublic static void flushAllOpenChannels(Interp interp)
interp
- the current interpreterpublic static void giveChannel(Interp master, Interp slave, String chanName, boolean removeFromMaster) throws TclException
master
- Interpreter giving the channelslave
- Interpreter receiving the channelchanName
- Name of channel to transferremoveFromMaster
- If true, channel is unregistered from the master after being
transferred
TclException
- if channel cannot be foundpublic static void unregisterChannel(Interp interp, Channel chan)
interp
- this interpreterchan
- channel to unregisterpublic static Channel getStdChannel(int type)
type
- one of StdChannel.STDIN, StdChannel.STDOUT, StdChannel.STDERR
public static String getNextDescriptor(Interp interp, String prefix)
interp
- current interpreter.prefix
- string portion of the channel name
public static String getTranslationString(int translation)
translation
- one of the TRANS_* constances
public static int getTranslationID(String translation)
translation
- one the fconfigure -translation strings
public static String getBufferingString(int buffering)
buffering
- one of TclIO.BUFF_FULL, TclIO.BUFF_LINE, TclIO.BUFF_NONE
public static int getBufferingID(String buffering)
buffering
- a buffering string used in fconfigure
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |