From b67a3f9b0aa06984d68aee6754bd74bd7004fd97 Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Wed, 12 Aug 2015 18:06:58 +0200 Subject: Add write_payload methods to stream_writer and tags --- include/io/stream_writer.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'include/io') diff --git a/include/io/stream_writer.h b/include/io/stream_writer.h index 78d02cb2cc..8c354cceba 100644 --- a/include/io/stream_writer.h +++ b/include/io/stream_writer.h @@ -23,18 +23,19 @@ #include "tag.h" #include "endian_str.h" #include -#include +//#include namespace nbt { namespace io { +/* Not sure if that is even needed ///Exception that gets thrown when writing is not successful class output_error : public std::runtime_error { using std::runtime_error::runtime_error; -}; +};*/ /** * @brief Helper class for writing NBT tags to output streams @@ -59,6 +60,16 @@ public: ///Returns the byte order endian::endian get_endian() const { return endian; } + /** + * @brief Writes a named tag into the stream, including the tag type + */ + void write_tag(const std::string& key, const tag& t); + + /** + * @brief Writes the given tag's payload into the stream + */ + void write_payload(const tag& t); + /** * @brief Writes a tag type to the stream */ -- cgit 0.0.5-2-1-g0f52