Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
class Stdin
super IFStream
+ super PollableIStream
+
private init do
_file = new NativeFile.native_stdin
path = "/dev/stdin"
prepare_buffer(1)
end
- # Is these something to read? (non blocking)
- # FIXME: should be generalized
- fun poll_in: Bool is extern "file_stdin_poll_in"
+ redef fun poll_in: Bool is extern "file_stdin_poll_in"
end
class Stdout
fun eof: Bool is abstract
end
+# IStream capable of declaring if readable without blocking
+interface PollableIStream
+ super IStream
+
+ # Is there something to read? (without blocking)
+ fun poll_in: Bool is abstract
+
+end
+
# Abstract output stream
interface OStream
super IOS