diff options
Diffstat (limited to 'lib/pure/streams.nim')
-rw-r--r-- | lib/pure/streams.nim | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/pure/streams.nim b/lib/pure/streams.nim index 9950c5877..b0ac62525 100644 --- a/lib/pure/streams.nim +++ b/lib/pure/streams.nim @@ -157,112 +157,112 @@ proc peek[T](s: Stream, result: var T) = raise newEIO("cannot read from stream") proc readChar*(s: Stream): char = - ## reads a char from the stream `s`. Raises `EIO` if an error occurred. + ## reads a char from the stream `s`. Raises `IOError` if an error occurred. ## Returns '\\0' as an EOF marker. if readData(s, addr(result), sizeof(result)) != 1: result = '\0' proc peekChar*(s: Stream): char = - ## peeks a char from the stream `s`. Raises `EIO` if an error occurred. + ## peeks a char from the stream `s`. Raises `IOError` if an error occurred. ## Returns '\\0' as an EOF marker. if peekData(s, addr(result), sizeof(result)) != 1: result = '\0' proc readBool*(s: Stream): bool = - ## reads a bool from the stream `s`. Raises `EIO` if an error occurred. + ## reads a bool from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekBool*(s: Stream): bool = - ## peeks a bool from the stream `s`. Raises `EIO` if an error occurred. + ## peeks a bool from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readInt8*(s: Stream): int8 = - ## reads an int8 from the stream `s`. Raises `EIO` if an error occurred. + ## reads an int8 from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekInt8*(s: Stream): int8 = - ## peeks an int8 from the stream `s`. Raises `EIO` if an error occurred. + ## peeks an int8 from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readInt16*(s: Stream): int16 = - ## reads an int16 from the stream `s`. Raises `EIO` if an error occurred. + ## reads an int16 from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekInt16*(s: Stream): int16 = - ## peeks an int16 from the stream `s`. Raises `EIO` if an error occurred. + ## peeks an int16 from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readInt32*(s: Stream): int32 = - ## reads an int32 from the stream `s`. Raises `EIO` if an error occurred. + ## reads an int32 from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekInt32*(s: Stream): int32 = - ## peeks an int32 from the stream `s`. Raises `EIO` if an error occurred. + ## peeks an int32 from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readInt64*(s: Stream): int64 = - ## reads an int64 from the stream `s`. Raises `EIO` if an error occurred. + ## reads an int64 from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekInt64*(s: Stream): int64 = - ## peeks an int64 from the stream `s`. Raises `EIO` if an error occurred. + ## peeks an int64 from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readUint8*(s: Stream): uint8 = - ## reads an uint8 from the stream `s`. Raises `EIO` if an error occurred. + ## reads an uint8 from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekUint8*(s: Stream): uint8 = - ## peeks an uint8 from the stream `s`. Raises `EIO` if an error occurred. + ## peeks an uint8 from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readUint16*(s: Stream): uint16 = - ## reads an uint16 from the stream `s`. Raises `EIO` if an error occurred. + ## reads an uint16 from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekUint16*(s: Stream): uint16 = - ## peeks an uint16 from the stream `s`. Raises `EIO` if an error occurred. + ## peeks an uint16 from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readUint32*(s: Stream): uint32 = - ## reads an uint32 from the stream `s`. Raises `EIO` if an error occurred. + ## reads an uint32 from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekUint32*(s: Stream): uint32 = - ## peeks an uint32 from the stream `s`. Raises `EIO` if an error occurred. + ## peeks an uint32 from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readUint64*(s: Stream): uint64 = - ## reads an uint64 from the stream `s`. Raises `EIO` if an error occurred. + ## reads an uint64 from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekUint64*(s: Stream): uint64 = - ## peeks an uint64 from the stream `s`. Raises `EIO` if an error occurred. + ## peeks an uint64 from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readFloat32*(s: Stream): float32 = - ## reads a float32 from the stream `s`. Raises `EIO` if an error occurred. + ## reads a float32 from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekFloat32*(s: Stream): float32 = - ## peeks a float32 from the stream `s`. Raises `EIO` if an error occurred. + ## peeks a float32 from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readFloat64*(s: Stream): float64 = - ## reads a float64 from the stream `s`. Raises `EIO` if an error occurred. + ## reads a float64 from the stream `s`. Raises `IOError` if an error occurred. read(s, result) proc peekFloat64*(s: Stream): float64 = - ## peeks a float64 from the stream `s`. Raises `EIO` if an error occurred. + ## peeks a float64 from the stream `s`. Raises `IOError` if an error occurred. peek(s, result) proc readStr*(s: Stream, length: int): TaintedString = - ## reads a string of length `length` from the stream `s`. Raises `EIO` if + ## reads a string of length `length` from the stream `s`. Raises `IOError` if ## an error occurred. result = newString(length).TaintedString var L = readData(s, cstring(result), length) if L != length: setLen(result.string, L) proc peekStr*(s: Stream, length: int): TaintedString = - ## peeks a string of length `length` from the stream `s`. Raises `EIO` if + ## peeks a string of length `length` from the stream `s`. Raises `IOError` if ## an error occurred. result = newString(length).TaintedString var L = peekData(s, cstring(result), length) @@ -301,7 +301,7 @@ proc peekLine*(s: Stream, line: var TaintedString): bool = proc readLine*(s: Stream): TaintedString = ## Reads a line from a stream `s`. Note: This is not very efficient. Raises - ## `EIO` if an error occurred. + ## `IOError` if an error occurred. result = TaintedString"" if s.atEnd: raise newEIO("cannot read from stream") @@ -317,7 +317,7 @@ proc readLine*(s: Stream): TaintedString = proc peekLine*(s: Stream): TaintedString = ## Peeks a line from a stream `s`. Note: This is not very efficient. Raises - ## `EIO` if an error occurred. + ## `IOError` if an error occurred. let pos = getPosition(s) defer: setPosition(s, pos) result = readLine(s) |