summaryrefslogtreecommitdiffstats
path: root/src/NBT/ShortTag.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/ShortTag.hpp
parent64f81ff50c3e221351c0b50a65c2d0b5289b4edf (diff)
downloadMinedMap-4b9bb2ab4894c52f60baba3273c27948ad022292.tar
MinedMap-4b9bb2ab4894c52f60baba3273c27948ad022292.zip
Add Tag print functions and nbtdump tool
Diffstat (limited to 'src/NBT/ShortTag.hpp')
-rw-r--r--src/NBT/ShortTag.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/NBT/ShortTag.hpp b/src/NBT/ShortTag.hpp
index 7415317..c08e1fe 100644
--- a/src/NBT/ShortTag.hpp
+++ b/src/NBT/ShortTag.hpp
@@ -47,6 +47,12 @@ public:
return Type::Short;
}
+ virtual void print(std::ostream& os, const std::string &) const {
+ os << getValue() << " / "
+ << (int16_t)getValue() << " / "
+ << std::hex << "0x" << getValue() << std::dec;
+ }
+
uint16_t getValue() const {
return Buffer::parse16(ptr);
}