From d7deea6dac9ca210a4dec273a7e10453492e04b5 Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Sat, 21 Apr 2018 22:21:05 +0200 Subject: Implement tag 12 (array of 64bit long) and fix tests --- include/nbt_visitor.h | 2 ++ include/tag.h | 1 + include/tag_array.h | 5 ++++- include/tag_list.h | 1 + include/tagfwd.h | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/nbt_visitor.h b/include/nbt_visitor.h index fd24ae22d7..fe2688afb9 100644 --- a/include/nbt_visitor.h +++ b/include/nbt_visitor.h @@ -46,6 +46,7 @@ public: virtual void visit(tag_list&) {} virtual void visit(tag_compound&) {} virtual void visit(tag_int_array&) {} + virtual void visit(tag_long_array&) {} }; /** @@ -69,6 +70,7 @@ public: virtual void visit(const tag_list&) {} virtual void visit(const tag_compound&) {} virtual void visit(const tag_int_array&) {} + virtual void visit(const tag_long_array&) {} }; inline nbt_visitor::~nbt_visitor() noexcept {} diff --git a/include/tag.h b/include/tag.h index 35c71dfd30..c4f1d5d0b2 100644 --- a/include/tag.h +++ b/include/tag.h @@ -43,6 +43,7 @@ enum class tag_type : int8_t List = 9, Compound = 10, Int_Array = 11, + Long_Array = 12, Null = -1 ///< Used to denote empty @ref value s }; diff --git a/include/tag_array.h b/include/tag_array.h index be9591c0f3..6e6a92bbeb 100644 --- a/include/tag_array.h +++ b/include/tag_array.h @@ -36,13 +36,14 @@ namespace detail template<> struct get_array_type : public std::integral_constant {}; template<> struct get_array_type : public std::integral_constant {}; + template<> struct get_array_type : public std::integral_constant {}; } ///@cond /** * @brief Tag that contains an array of byte or int values * - * Common class for tag_byte_array and tag_int_array. + * Common class for tag_byte_array, tag_int_array and tag_long_array. */ template class tag_array final : public detail::crtp_tag> @@ -123,10 +124,12 @@ template bool operator!=(const tag_array& lhs, const tag_array& r //Typedefs that should be used instead of the template tag_array. typedef tag_array tag_byte_array; typedef tag_array tag_int_array; +typedef tag_array tag_long_array; //Explicit instantiations template class NBT_EXPORT tag_array; template class NBT_EXPORT tag_array; +template class NBT_EXPORT tag_array; } diff --git a/include/tag_list.h b/include/tag_list.h index c6a568ec36..ecd7e89c11 100644 --- a/include/tag_list.h +++ b/include/tag_list.h @@ -81,6 +81,7 @@ public: tag_list(std::initializer_list init); tag_list(std::initializer_list init); tag_list(std::initializer_list init); + tag_list(std::initializer_list init); /** * @brief Constructs a list with the given contents diff --git a/include/tagfwd.h b/include/tagfwd.h index 178edd7e47..a359885ce1 100644 --- a/include/tagfwd.h +++ b/include/tagfwd.h @@ -42,6 +42,7 @@ class tag_string; template class tag_array; typedef tag_array tag_byte_array; typedef tag_array tag_int_array; +typedef tag_array tag_long_array; class tag_list; class tag_compound; -- cgit 0.0.5-2-1-g0f52