summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorindianpojken <io.qrdr@gmail.com>2017-10-09 17:44:45 +0200
committerGitHub <noreply@github.com>2017-10-09 17:44:45 +0200
commita16062bf91a763b62dfcdaca0efa617ad583b8f2 (patch)
tree668aafb4a4aaace5ca09ada653faab5e16294a22 /lib
parentd55e02ddf12662781cf89e2fd91473dbf7552e5a (diff)
downloadNim-a16062bf91a763b62dfcdaca0efa617ad583b8f2.tar.gz
Adds uintX variants to read/peek procs
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/streams.nim32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/pure/streams.nim b/lib/pure/streams.nim
index 69f673990..d54f4b963 100644
--- a/lib/pure/streams.nim
+++ b/lib/pure/streams.nim
@@ -232,6 +232,38 @@ proc peekFloat32*(s: Stream): float32 =
   ## peeks a float32 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 readFloat64*(s: Stream): float64 =
   ## reads a float64 from the stream `s`. Raises `EIO` if an error occurred.
   read(s, result)