mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Update documentation for os2 once more!
This commit is contained in:
@@ -2,6 +2,7 @@ package os2
|
||||
|
||||
import "core:io"
|
||||
|
||||
// Converts a file `f` into an `io.Stream`
|
||||
to_stream :: proc(f: ^File) -> (s: io.Stream) {
|
||||
if f != nil {
|
||||
assert(f.stream.procedure != nil)
|
||||
@@ -10,14 +11,16 @@ to_stream :: proc(f: ^File) -> (s: io.Stream) {
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
This is an alias of `to_stream` which converts a file `f` to an `io.Stream`.
|
||||
It can be useful to indicate what the stream is meant to be used for as a writer,
|
||||
even if it has no logical difference.
|
||||
*/
|
||||
to_writer :: to_stream
|
||||
|
||||
/*
|
||||
This is an alias of `to_stream` which converts a file `f` to an `io.Stream`.
|
||||
It can be useful to indicate what the stream is meant to be used for as a reader,
|
||||
even if it has no logical difference.
|
||||
*/
|
||||
to_reader :: to_stream
|
||||
|
||||
|
||||
@(private)
|
||||
error_to_io_error :: proc(ferr: Error) -> io.Error {
|
||||
if ferr == nil {
|
||||
return .None
|
||||
}
|
||||
return ferr.(io.Error) or_else .Unknown
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user