|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyObject
org.jruby.RubyIO
Field Summary | |
protected static int |
fileno
|
protected IOHandler |
handler
|
protected static java.util.Hashtable |
ioHandlers
|
protected boolean |
isOpen
|
protected int |
lineNumber
|
protected IOModes |
modes
|
static int |
STDERR
|
static int |
STDIN
|
static int |
STDOUT
|
Fields inherited from class org.jruby.RubyObject |
runtime |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
NULL_ARRAY |
Constructor Summary | |
|
RubyIO(Ruby ruby,
int descriptor)
|
|
RubyIO(Ruby ruby,
java.io.OutputStream outputStream)
|
protected |
RubyIO(Ruby ruby,
RubyClass type)
|
Method Summary | |
IRubyObject |
addString(IRubyObject anObject)
rb_io_addstr |
protected void |
checkReadable()
|
protected void |
checkWriteable()
|
RubyIO |
clone_IO()
|
IRubyObject |
close()
Closes all open resources for the IO. |
RubyBoolean |
closed()
Closes the IO. |
static RubyClass |
createIOClass(Ruby ruby)
|
IRubyObject |
each_byte()
Invoke a block for each byte. |
RubyIO |
each_line(IRubyObject[] args)
Invoke a block for each line. |
RubyBoolean |
eof()
|
static IRubyObject |
fdOpen(Ruby ruby,
int descriptor)
Open a file descriptor, unless it is already open, then return it. |
RubyFixnum |
fileno()
|
void |
finalize()
|
RubyIO |
flush()
Flushes the IO output stream. |
static IRubyObject |
foreach(IRubyObject recv,
IRubyObject filename,
IRubyObject[] args)
rb_io_s_foreach |
RubyFixnum |
fsync()
|
IRubyObject |
getc()
Read a byte. |
java.io.InputStream |
getInStream()
|
static IOHandler |
getIOHandlerByFileno(int fileno)
|
static int |
getNewFileno()
|
java.io.OutputStream |
getOutStream()
|
RubyString |
gets(IRubyObject[] args)
Read a line. |
IRubyObject |
initialize(RubyFixnum descriptor,
IRubyObject[] args)
rb_io_initialize |
RubyString |
internalGets(IRubyObject[] args)
Read a line. |
protected boolean |
isOpen()
|
RubyFixnum |
lineno_set(RubyFixnum newLineNumber)
Sets the current line number. |
RubyFixnum |
lineno()
Returns the current line number. |
static IRubyObject |
newInstance(IRubyObject recv,
IRubyObject[] args)
rb_io_s_new |
IRubyObject |
pid()
Return the process id (pid) of the process this IO object spawned. |
RubyFixnum |
pos_set(RubyFixnum newPosition)
|
RubyFixnum |
pos()
|
static IRubyObject |
print(IRubyObject recv,
IRubyObject[] args)
Print some objects to the stream. |
static IRubyObject |
printf(IRubyObject recv,
IRubyObject[] args)
|
IRubyObject |
putc(IRubyObject object)
|
static IRubyObject |
puts(IRubyObject recv,
IRubyObject[] args)
|
IRubyObject |
read(IRubyObject[] args)
|
IRubyObject |
readchar()
Read a byte. |
RubyString |
readline(IRubyObject[] args)
Read a line. |
RubyArray |
readlines(IRubyObject[] args)
|
static RubyArray |
readlines(IRubyObject recv,
IRubyObject[] args)
|
static void |
registerIOHandler(IOHandler handler)
|
IRubyObject |
reopen(IRubyObject arg1,
IRubyObject[] args)
|
RubyFixnum |
rewind()
|
RubyFixnum |
seek(IRubyObject[] args)
|
IRubyObject |
sync_set(RubyBoolean newSync)
Sets the current sync mode. |
RubyBoolean |
sync()
Returns the current sync mode. |
IRubyObject |
sysread(RubyFixnum number)
|
IRubyObject |
syswrite(IRubyObject obj)
|
java.lang.String |
toString()
|
IRubyObject |
ungetc(RubyFixnum number)
Pushes char represented by int back onto IOS. |
static void |
unregisterIOHandler(int fileno)
|
IRubyObject |
write(IRubyObject obj)
io_write |
Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int STDIN
public static final int STDOUT
public static final int STDERR
protected IOHandler handler
protected IOModes modes
protected int lineNumber
protected boolean isOpen
protected static java.util.Hashtable ioHandlers
protected static int fileno
Constructor Detail |
protected RubyIO(Ruby ruby, RubyClass type)
public RubyIO(Ruby ruby, java.io.OutputStream outputStream)
public RubyIO(Ruby ruby, int descriptor)
Method Detail |
public static void registerIOHandler(IOHandler handler)
public static void unregisterIOHandler(int fileno)
public static IOHandler getIOHandlerByFileno(int fileno)
public static int getNewFileno()
public static RubyClass createIOClass(Ruby ruby)
public static IRubyObject fdOpen(Ruby ruby, int descriptor)
Open a file descriptor, unless it is already open, then return it.
protected void checkWriteable()
protected void checkReadable()
protected boolean isOpen()
public java.io.OutputStream getOutStream()
public java.io.InputStream getInStream()
public IRubyObject reopen(IRubyObject arg1, IRubyObject[] args)
public RubyString internalGets(IRubyObject[] args)
public static IRubyObject newInstance(IRubyObject recv, IRubyObject[] args)
public static IRubyObject foreach(IRubyObject recv, IRubyObject filename, IRubyObject[] args)
public IRubyObject initialize(RubyFixnum descriptor, IRubyObject[] args)
public IRubyObject syswrite(IRubyObject obj)
public IRubyObject write(IRubyObject obj)
public IRubyObject addString(IRubyObject anObject)
public RubyFixnum fileno()
public RubyFixnum lineno()
public RubyFixnum lineno_set(RubyFixnum newLineNumber)
newLineNumber
- The new line number.public RubyBoolean sync()
public IRubyObject pid()
Return the process id (pid) of the process this IO object spawned. If no process exists (popen was not called), then nil is returned. This is not how it appears to be defined but ruby 1.8 works this way.
public RubyFixnum pos()
public RubyFixnum pos_set(RubyFixnum newPosition)
public IRubyObject putc(IRubyObject object)
public RubyFixnum seek(IRubyObject[] args)
public RubyFixnum rewind()
public RubyFixnum fsync()
public IRubyObject sync_set(RubyBoolean newSync)
newSync
- The new sync mode.public RubyBoolean eof()
public RubyIO clone_IO()
public RubyBoolean closed()
public IRubyObject close()
Closes all open resources for the IO. It also removes it from our magical all open file descriptor pool.
public RubyIO flush()
public RubyString gets(IRubyObject[] args)
public RubyString readline(IRubyObject[] args)
public IRubyObject getc()
public IRubyObject ungetc(RubyFixnum number)
Pushes char represented by int back onto IOS.
number
- to push backpublic IRubyObject sysread(RubyFixnum number)
public IRubyObject read(IRubyObject[] args)
public IRubyObject readchar()
public IRubyObject each_byte()
Invoke a block for each byte.
public RubyIO each_line(IRubyObject[] args)
Invoke a block for each line.
public static IRubyObject puts(IRubyObject recv, IRubyObject[] args)
public static IRubyObject print(IRubyObject recv, IRubyObject[] args)
public static IRubyObject printf(IRubyObject recv, IRubyObject[] args)
public RubyArray readlines(IRubyObject[] args)
public static RubyArray readlines(IRubyObject recv, IRubyObject[] args)
public java.lang.String toString()
toString
in class RubyObject
public void finalize() throws java.lang.Throwable
java.lang.Throwable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |