summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tag.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tag.cpp b/src/tag.cpp
index da5c3fa68e..76c850f3c8 100644
--- a/src/tag.cpp
+++ b/src/tag.cpp
@@ -18,6 +18,7 @@
* along with libnbt++. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tag.h"
+#include <ostream>
#include <typeinfo>
namespace nbt
@@ -40,4 +41,25 @@ bool operator!=(const tag& lhs, const tag& rhs)
return !(lhs == rhs);
}
+std::ostream& operator<<(std::ostream& os, tag_type tt)
+{
+ switch(tt)
+ {
+ case tag_type::End: return os << "end";
+ case tag_type::Byte: return os << "byte";
+ case tag_type::Short: return os << "short";
+ case tag_type::Int: return os << "int";
+ case tag_type::Long: return os << "long";
+ case tag_type::Float: return os << "float";
+ case tag_type::Double: return os << "double";
+ case tag_type::Byte_Array: return os << "byte_array";
+ case tag_type::List: return os << "list";
+ case tag_type::Compound: return os << "compound";
+ case tag_type::Int_Array: return os << "int_array";
+ case tag_type::Null: return os << "null";
+
+ default: return os << "invalid";
+ }
+}
+
}