lib/standard: Updated documentation of Streams to fit new names.
authorLucas Bajolet <r4pass@hotmail.com>
Mon, 9 Feb 2015 16:51:58 +0000 (11:51 -0500)
committerLucas Bajolet <r4pass@hotmail.com>
Tue, 10 Feb 2015 19:00:22 +0000 (14:00 -0500)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/standard/exec.nit
lib/standard/file.nit
lib/standard/stream.nit
lib/standard/string.nit

index 13cd7a0..d9a0704 100644 (file)
@@ -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
index a777028..2009a50 100644 (file)
@@ -32,7 +32,7 @@ in "C Header" `{
        #include <errno.h>
 `}
 
-# 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
index 24681fe..476c684 100644 (file)
@@ -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
index 1af06b7..88c4074 100644 (file)
@@ -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