From 473f094be33ccd92c003ec25c9a9f940629ecdc9 Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Wed, 22 Jul 2015 15:20:32 +0200 Subject: Add operator<< for tag_type --- src/tag.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') 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 . */ #include "tag.h" +#include #include 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"; + } +} + } -- cgit 0.0.5-2-1-g0f52