diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-07-22 16:55:31 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-07-22 16:55:31 +0200 |
commit | a85fd8bcf45ec7f4238e7e997d54e19756e564fc (patch) | |
tree | ec7ff93d05aaecbf1a0845ebcc05134fbfc5762c /src/NBT | |
parent | 59e0ce1f0c9c1076ebbd1a4667fa303642f43f33 (diff) | |
download | MinedMap-a85fd8bcf45ec7f4238e7e997d54e19756e564fc.tar MinedMap-a85fd8bcf45ec7f4238e7e997d54e19756e564fc.zip |
NBT: String: add data accessor
Diffstat (limited to 'src/NBT')
-rw-r--r-- | src/NBT/StringTag.hpp | 6 |
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() << "\""; } }; |