diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2017-10-16 15:43:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-16 15:43:15 +0100 |
commit | 098bf809b9bc2d58e6271e950d3caff7d19bfa64 (patch) | |
tree | 897fdb20d784a6d7df0df67bfa66b8f584d0a957 /lib | |
parent | 7eeef4aae7391f0e9e53c9009cf722545cee954c (diff) | |
parent | 12d7503f76bfa54946efa2754c30c026ea253eb4 (diff) | |
download | Nim-098bf809b9bc2d58e6271e950d3caff7d19bfa64.tar.gz |
Merge pull request #6491 from indianpojken/patch-1
Implement uintX variants for read/peek.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/streams.nim | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/pure/streams.nim b/lib/pure/streams.nim index 69f673990..354e07da3 100644 --- a/lib/pure/streams.nim +++ b/lib/pure/streams.nim @@ -224,6 +224,38 @@ proc peekInt64*(s: Stream): int64 = ## peeks an int64 from the stream `s`. Raises `EIO` 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. + read(s, result) + +proc peekUint8*(s: Stream): uint8 = + ## peeks an uint8 from the stream `s`. Raises `EIO` 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. + read(s, result) + +proc peekUint16*(s: Stream): uint16 = + ## peeks an uint16 from the stream `s`. Raises `EIO` 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. + read(s, result) + +proc peekUint32*(s: Stream): uint32 = + ## peeks an uint32 from the stream `s`. Raises `EIO` 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. + read(s, result) + +proc peekUint64*(s: Stream): uint64 = + ## peeks an uint64 from the stream `s`. Raises `EIO` 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. read(s, result) |