summaryrefslogtreecommitdiff
path: root/include/io
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-08-04 20:19:45 +0200
committerljfa-ag <ljfa-ag@web.de>2015-08-04 20:19:45 +0200
commit40435a6da8392c86fd120ec6b4fbda0bd1c89ab3 (patch)
treedc9ea550a3e49259cca847e049f76306f3ed6014 /include/io
parent5e750cf89484c3229100534137def1627368146c (diff)
downloadProject-Tick-40435a6da8392c86fd120ec6b4fbda0bd1c89ab3.tar.gz
Project-Tick-40435a6da8392c86fd120ec6b4fbda0bd1c89ab3.zip
Implement stream_reader
Diffstat (limited to 'include/io')
-rw-r--r--include/io/stream_reader.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/io/stream_reader.h b/include/io/stream_reader.h
index ab07f83ad9..5d10e021ed 100644
--- a/include/io/stream_reader.h
+++ b/include/io/stream_reader.h
@@ -65,8 +65,7 @@ public:
/**
* @brief Reads a binary number from the stream
- *
- * Does not check if the reading actually succeeds
+ * @throw input_error on failure
*/
template<class T>
void read_num(T& x);
@@ -85,6 +84,12 @@ private:
const endian::endian endian;
};
+template<class T>
+void stream_reader::read_num(T& x)
+{
+ endian::read(is, x, endian);
+}
+
}
}