private fun basic_exec_execute(p: NativeString, av: NativeString, ac: Int, pf: Int): NativeProcess is extern "exec_Process_Process_basic_exec_execute_4"
end
-# stdout of the process is readable
+# `Process` on which the `stdout` is readable like a `Reader`
class ProcessReader
super Process
super Reader
end
end
-# stdin of the process is writable
+# `Process` on which `stdin` is writable like a `Writer`
class ProcessWriter
super Process
super Writer
end
end
-# stdin and stdout are both accessible
+# `Process` on which stdout can be read and stdin can be written to like a `Duplex`
class ProcessDuplex
super ProcessReader
super ProcessWriter
super Error
end
-# Abstract stream class
+# Any kind of stream to read/write/both to or from a source
abstract class Stream
# Error produced by the file stream
#
fun close is abstract
end
-# Abstract input streams
+# A `Stream` that can be read from
abstract class Reader
super Stream
# Read a character. Return its ASCII value, -1 on EOF or timeout
end
end
-# `ReadStream` capable of declaring if readable without blocking
+# `Reader` capable of declaring if readable without blocking
abstract class PollableReader
super Reader
end
-# Abstract output stream
+# A `Stream` that can be written to
abstract class Writer
super Stream
# write a string
fun is_writable: Bool is abstract
end
-# Things that can be efficienlty writen to a `WriteStream`
+# Things that can be efficienlty written to a `Writer`
#
-# The point of this interface it to allow is instance to be efficenty
-# writen into a `WriteStream` without having to allocate a big String object
+# The point of this interface is to allow the instance to be efficiently
+# written into a `Writer`.
#
-# ready-to-save documents usually provide this interface.
+# Ready-to-save documents usually provide this interface.
interface Writable
# Write itself to a `stream`
# The specific logic it let to the concrete subclasses
redef fun write_to(stream) do stream.write(self)
end
-# Input streams with a buffer
+# Input streams with a buffered input for efficiency purposes
abstract class BufferedReader
super Reader
redef fun read_char
end
end
-# An Input/Output Stream
+# A `Stream` that can be written to and read from
abstract class Duplex
super Reader
super Writer
end
-# Stream to a String.
+# `Stream` that can be used to write to a `String`
#
# Mainly used for compatibility with Writer type and tests.
class StringWriter
redef fun close do closed = true
end
-# Stream from a String.
+# `Stream` used to read from a `String`
#
# Mainly used for compatibility with Reader type and tests.
class StringReader
# assert "\r\n\r\n".chomp == "\r\n"
# assert "\r\n\r".chomp == "\r\n"
#
- # Note: unlike with most IO methods like `IStream::read_line`,
+ # Note: unlike with most IO methods like `Reader::read_line`,
# a single `\r` is considered here to be a line terminator and will be removed.
fun chomp: SELFTYPE
do