From 34f3da63abc971d68c544137ba7fae66bb8a1d06 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Mon, 9 Feb 2015 11:51:58 -0500 Subject: [PATCH 1/1] lib/standard: Updated documentation of Streams to fit new names. Signed-off-by: Lucas Bajolet --- lib/standard/exec.nit | 6 +++--- lib/standard/file.nit | 6 +++--- lib/standard/stream.nit | 24 ++++++++++++------------ lib/standard/string.nit | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/standard/exec.nit b/lib/standard/exec.nit index 13cd7a0..d9a0704 100644 --- a/lib/standard/exec.nit +++ b/lib/standard/exec.nit @@ -87,7 +87,7 @@ class Process 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 @@ -110,7 +110,7 @@ class ProcessReader end end -# stdin of the process is writable +# `Process` on which `stdin` is writable like a `Writer` class ProcessWriter super Process super Writer @@ -133,7 +133,7 @@ class ProcessWriter 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 diff --git a/lib/standard/file.nit b/lib/standard/file.nit index a777028..2009a50 100644 --- a/lib/standard/file.nit +++ b/lib/standard/file.nit @@ -32,7 +32,7 @@ in "C Header" `{ #include `} -# File Abstract Stream +# `Stream` used to interact with a File or FileDescriptor abstract class FileStream super Stream # The path of the file. @@ -63,7 +63,7 @@ abstract class FileStream end end -# File input stream +# `Stream` that can read from a File class FileReader super FileStream super BufferedReader @@ -133,7 +133,7 @@ class FileReader end end -# File output stream +# `Stream` that can write to a File class FileWriter super FileStream super Writer diff --git a/lib/standard/stream.nit b/lib/standard/stream.nit index 24681fe..476c684 100644 --- a/lib/standard/stream.nit +++ b/lib/standard/stream.nit @@ -25,7 +25,7 @@ class IOError 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 # @@ -39,7 +39,7 @@ abstract class 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 @@ -269,7 +269,7 @@ class LineIterator end end -# `ReadStream` capable of declaring if readable without blocking +# `Reader` capable of declaring if readable without blocking abstract class PollableReader super Reader @@ -278,7 +278,7 @@ abstract class PollableReader end -# Abstract output stream +# A `Stream` that can be written to abstract class Writer super Stream # write a string @@ -288,12 +288,12 @@ abstract class Writer 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 @@ -317,7 +317,7 @@ redef class Text 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 @@ -439,13 +439,13 @@ abstract class BufferedReader 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 @@ -466,7 +466,7 @@ 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 diff --git a/lib/standard/string.nit b/lib/standard/string.nit index 1af06b7..88c4074 100644 --- a/lib/standard/string.nit +++ b/lib/standard/string.nit @@ -401,7 +401,7 @@ abstract class Text # 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 -- 1.7.9.5