summaryrefslogtreecommitdiffstats
path: root/src/NBT
diff options
context:
space:
mode:
Diffstat (limited to 'src/NBT')
-rw-r--r--src/NBT/StringTag.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/NBT/StringTag.hpp b/src/NBT/StringTag.hpp
index 8672b73..6fb2b41 100644
--- a/src/NBT/StringTag.hpp
+++ b/src/NBT/StringTag.hpp
@@ -50,8 +50,12 @@ public:
return Type;
}
+ std::string getValue() const {
+ return std::string(reinterpret_cast<const char *>(ptr), len);
+ }
+
virtual void print(std::ostream& os, const std::string &) const {
- os << "\"" << std::string(reinterpret_cast<const char *>(ptr), len) << "\"";
+ os << "\"" << getValue() << "\"";
}
};