summaryrefslogtreecommitdiff
path: root/include/io
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-08-04 20:00:24 +0200
committerljfa-ag <ljfa-ag@web.de>2015-08-04 20:00:24 +0200
commit5e750cf89484c3229100534137def1627368146c (patch)
treee1ec336b944675af8cac6c72a19af3446bfb055d /include/io
parent5f86fd9785b417aef6fec7a9f913bc4349d6c59b (diff)
downloadProject-Tick-5e750cf89484c3229100534137def1627368146c.tar.gz
Project-Tick-5e750cf89484c3229100534137def1627368146c.zip
Small changes to stream_reader documentation
Diffstat (limited to 'include/io')
-rw-r--r--include/io/stream_reader.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/io/stream_reader.h b/include/io/stream_reader.h
index 659aacbd82..ab07f83ad9 100644
--- a/include/io/stream_reader.h
+++ b/include/io/stream_reader.h
@@ -39,6 +39,7 @@ public:
///Exception that gets thrown when reading is not successful
class input_error : public std::runtime_error
{
+ public:
input_error(const std::string& what_arg):
std::runtime_error(what_arg) {}
};
@@ -55,16 +56,27 @@ public:
///Returns the byte order
endian::endian get_endian() const;
- ///Reads a tag type from the stream
+ /**
+ * @brief Reads a tag type from the stream
+ * @param allow_end whether to consider tag_type::End valid
+ * @throw input_error on failure
+ */
tag_type read_type(bool allow_end = false);
- ///Reads a number from the stream
+
+ /**
+ * @brief Reads a binary number from the stream
+ *
+ * Does not check if the reading actually succeeds
+ */
template<class T>
void read_num(T& x);
+
/**
* @brief Reads an NBT string from the stream
*
* An NBT string consists of two bytes indicating the length, followed by
* the characters encoded in modified UTF-8.
+ * @throw input_error on failure
*/
std::string read_string();