summaryrefslogtreecommitdiffstats
path: root/src/NBT/Tag.hpp
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-07-20 23:09:33 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-07-20 23:49:50 +0200
commit4b9bb2ab4894c52f60baba3273c27948ad022292 (patch)
tree1bbe847b339fb3f332fd79e4f0b045d64717f2e1 /src/NBT/Tag.hpp
parent64f81ff50c3e221351c0b50a65c2d0b5289b4edf (diff)
downloadMinedMap-4b9bb2ab4894c52f60baba3273c27948ad022292.tar
MinedMap-4b9bb2ab4894c52f60baba3273c27948ad022292.zip
Add Tag print functions and nbtdump tool
Diffstat (limited to 'src/NBT/Tag.hpp')
-rw-r--r--src/NBT/Tag.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/NBT/Tag.hpp b/src/NBT/Tag.hpp
index a3c0c76..bb71b23 100644
--- a/src/NBT/Tag.hpp
+++ b/src/NBT/Tag.hpp
@@ -60,11 +60,18 @@ public:
static std::pair<std::string, std::shared_ptr<const Tag>> readNamedTag(Buffer *buffer);
virtual Type getType() const = 0;
+ virtual void print(std::ostream& os, const std::string &indent) const = 0;
virtual ~Tag() {}
};
std::ostream& operator<<(std::ostream& os, Tag::Type type);
+static inline std::ostream& operator<<(std::ostream& os, const Tag &tag) {
+ os << tag.getType() << " ";
+ tag.print(os, "");
+ return os;
+}
+
}
}