diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-07-20 23:09:33 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-07-20 23:49:50 +0200 |
commit | 4b9bb2ab4894c52f60baba3273c27948ad022292 (patch) | |
tree | 1bbe847b339fb3f332fd79e4f0b045d64717f2e1 /src/NBT/ListTag.hpp | |
parent | 64f81ff50c3e221351c0b50a65c2d0b5289b4edf (diff) | |
download | MinedMap-4b9bb2ab4894c52f60baba3273c27948ad022292.tar MinedMap-4b9bb2ab4894c52f60baba3273c27948ad022292.zip |
Add Tag print functions and nbtdump tool
Diffstat (limited to 'src/NBT/ListTag.hpp')
-rw-r--r-- | src/NBT/ListTag.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/NBT/ListTag.hpp b/src/NBT/ListTag.hpp index 757a0aa..833c41e 100644 --- a/src/NBT/ListTag.hpp +++ b/src/NBT/ListTag.hpp @@ -65,6 +65,20 @@ public: virtual Type getSubtype() const { return type; } + + virtual void print(std::ostream& os, const std::string &indent) const { + os << getSubtype() << " [" << std::endl; + + std::string inner = indent + " "; + + for (const auto &item : *this) { + os << inner; + item->print(os, inner); + os << std::endl; + } + + os << indent << "]"; + } }; } |