summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/io/stream_reader.cpp10
-rw-r--r--src/io/stream_writer.cpp5
2 files changed, 15 insertions, 0 deletions
diff --git a/src/io/stream_reader.cpp b/src/io/stream_reader.cpp
index 15f29dba1d..f6f30a5b49 100644
--- a/src/io/stream_reader.cpp
+++ b/src/io/stream_reader.cpp
@@ -27,6 +27,16 @@ namespace nbt
namespace io
{
+std::pair<std::string, std::unique_ptr<tag_compound>> read_compound(std::istream& is, endian::endian e)
+{
+ return stream_reader(is, e).read_compound();
+}
+
+std::pair<std::string, std::unique_ptr<tag>> read_tag(std::istream& is, endian::endian e)
+{
+ return stream_reader(is, e).read_tag();
+}
+
stream_reader::stream_reader(std::istream& is, endian::endian e) noexcept:
is(is), endian(e)
{}
diff --git a/src/io/stream_writer.cpp b/src/io/stream_writer.cpp
index f21fdb701c..ee8b0ee2b6 100644
--- a/src/io/stream_writer.cpp
+++ b/src/io/stream_writer.cpp
@@ -25,6 +25,11 @@ namespace nbt
namespace io
{
+void write_tag(const std::string& key, const tag& t, std::ostream& os, endian::endian e)
+{
+ stream_writer(os, e).write_tag(key, t);
+}
+
void stream_writer::write_tag(const std::string& key, const tag& t)
{
write_type(t.get_type());