summaryrefslogtreecommitdiff
path: root/include/io
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-08-12 18:06:58 +0200
committerljfa-ag <ljfa-ag@web.de>2015-08-12 18:06:58 +0200
commitb67a3f9b0aa06984d68aee6754bd74bd7004fd97 (patch)
tree43461ea6cd7bf984e93521145fbae1593c72d23b /include/io
parent1178dbef6290d0a87d478ea06b11cf19e2e7b1d7 (diff)
downloadProject-Tick-b67a3f9b0aa06984d68aee6754bd74bd7004fd97.tar.gz
Project-Tick-b67a3f9b0aa06984d68aee6754bd74bd7004fd97.zip
Add write_payload methods to stream_writer and tags
Diffstat (limited to 'include/io')
-rw-r--r--include/io/stream_writer.h15
1 files changed, 13 insertions, 2 deletions
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 <iosfwd>
-#include <stdexcept>
+//#include <stdexcept>
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
@@ -60,6 +61,16 @@ public:
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
*/
void write_type(tag_type tt);