Making everything load
parent
641c61a966
commit
fb9d7b05cd
|
@ -1 +0,0 @@
|
|||
Slava Pestov
|
|
@ -1,17 +0,0 @@
|
|||
USING: help.markup help.syntax io strings ;
|
||||
IN: io.streams.lines
|
||||
|
||||
ARTICLE: "io.streams.lines" "Line reader streams"
|
||||
"Line reader streams wrap an underlying stream and provide a default implementation of " { $link stream-readln } "."
|
||||
{ $subsection line-reader }
|
||||
{ $subsection <line-reader> } ;
|
||||
|
||||
ABOUT: "io.streams.lines"
|
||||
|
||||
HELP: line-reader
|
||||
{ $class-description "An input stream which delegates to an underlying stream while providing an implementation of the " { $link stream-readln } " word in terms of the underlying stream's " { $link stream-read-until } ". Line readers are created by calling " { $link <line-reader> } "." } ;
|
||||
|
||||
HELP: <line-reader>
|
||||
{ $values { "stream" "an input stream" } { "new-stream" "an input stream" } }
|
||||
{ $description "Creates a new " { $link line-reader } "." }
|
||||
{ $notes "Stream constructors should call this word to wrap streams that do not natively support reading lines. Unix (" { $snippet "\\n" } "), Windows (" { $snippet "\\r\\n" } ") and MacOS (" { $snippet "\\r" } ") line endings are supported." } ;
|
|
@ -1,58 +0,0 @@
|
|||
USING: io.streams.lines io.files io.streams.string io
|
||||
tools.test kernel io.encodings.ascii ;
|
||||
IN: temporary
|
||||
|
||||
: <resource-reader> ( resource -- stream )
|
||||
resource-path ascii <file-reader> ;
|
||||
|
||||
[ { } ]
|
||||
[ "/core/io/test/empty-file.txt" <resource-reader> lines ]
|
||||
unit-test
|
||||
|
||||
: lines-test ( stream -- line1 line2 )
|
||||
[ readln readln ] with-stream ;
|
||||
|
||||
[
|
||||
"This is a line."
|
||||
"This is another line."
|
||||
] [
|
||||
"/core/io/test/windows-eol.txt" <resource-reader> lines-test
|
||||
] unit-test
|
||||
|
||||
[
|
||||
"This is a line."
|
||||
"This is another line."
|
||||
] [
|
||||
"/core/io/test/mac-os-eol.txt" <resource-reader> lines-test
|
||||
] unit-test
|
||||
|
||||
[
|
||||
"This is a line."
|
||||
"This is another line."
|
||||
] [
|
||||
"/core/io/test/unix-eol.txt" <resource-reader> lines-test
|
||||
] unit-test
|
||||
|
||||
[
|
||||
"1234"
|
||||
] [
|
||||
"Hello world\r\n1234" <string-reader>
|
||||
dup stream-readln drop
|
||||
4 swap stream-read
|
||||
] unit-test
|
||||
|
||||
[
|
||||
"1234"
|
||||
] [
|
||||
"Hello world\r\n1234" <string-reader>
|
||||
dup stream-readln drop
|
||||
4 swap stream-read-partial
|
||||
] unit-test
|
||||
|
||||
[
|
||||
CHAR: 1
|
||||
] [
|
||||
"Hello world\r\n1234" <string-reader>
|
||||
dup stream-readln drop
|
||||
stream-read1
|
||||
] unit-test
|
|
@ -1,7 +0,0 @@
|
|||
! Copyright (C) 2004, 2007 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
IN: io.streams.lines
|
||||
! USING: io.encodings.latin1 io.encodings ;
|
||||
|
||||
! : <line-reader> ( stream -- new-stream )
|
||||
! latin1 <decoded> ;
|
|
@ -1 +0,0 @@
|
|||
Read lines of text from a character-oriented stream
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2007 Elie Chaftari, Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.c-types alien.syntax destructors hexdump io
|
||||
io.buffers io.nonblocking io.sockets io.streams.lines
|
||||
io.buffers io.nonblocking io.sockets
|
||||
io.unix.backend io.unix.files kernel libc locals math qualified
|
||||
sequences io.sniffer.backend ;
|
||||
QUALIFIED: unix
|
Loading…
Reference in New Issue