summaryrefslogtreecommitdiffstats
path: root/src/NBT/CompoundTag.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/NBT/CompoundTag.hpp')
-rw-r--r--src/NBT/CompoundTag.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/NBT/CompoundTag.hpp b/src/NBT/CompoundTag.hpp
index 39fa25d..6be0479 100644
--- a/src/NBT/CompoundTag.hpp
+++ b/src/NBT/CompoundTag.hpp
@@ -54,6 +54,20 @@ public:
return Type::Compound;
}
+ virtual void print(std::ostream& os, const std::string &indent) const {
+ os << "{" << std::endl;
+
+ std::string inner = indent + " ";
+
+ for (const auto &item : *this) {
+ os << inner << item.first << ": " << item.second->getType() << " ";
+ item.second->print(os, inner);
+ os << std::endl;
+ }
+
+ os << indent << "}";
+ }
+
template<typename T> std::shared_ptr<const T> get(const std::string &key) const {
auto it = find(key);
if (it == end())