summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-04-21 22:21:05 +0200
committerPetr Mrázek <peterix@gmail.com>2020-06-07 21:23:04 +0200
commitd7deea6dac9ca210a4dec273a7e10453492e04b5 (patch)
treecd64d0170695fe72509641045c866330946f05d1 /include
parent92f8d57227feb94643378ecf595626c60c0f59b8 (diff)
downloadProject-Tick-d7deea6dac9ca210a4dec273a7e10453492e04b5.tar.gz
Project-Tick-d7deea6dac9ca210a4dec273a7e10453492e04b5.zip
Implement tag 12 (array of 64bit long) and fix tests
Diffstat (limited to 'include')
-rw-r--r--include/nbt_visitor.h2
-rw-r--r--include/tag.h1
-rw-r--r--include/tag_array.h5
-rw-r--r--include/tag_list.h1
-rw-r--r--include/tagfwd.h1
5 files changed, 9 insertions, 1 deletions
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<int8_t> : public std::integral_constant<tag_type, tag_type::Byte_Array> {};
template<> struct get_array_type<int32_t> : public std::integral_constant<tag_type, tag_type::Int_Array> {};
+ template<> struct get_array_type<int64_t> : public std::integral_constant<tag_type, tag_type::Long_Array> {};
}
///@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 T>
class tag_array final : public detail::crtp_tag<tag_array<T>>
@@ -123,10 +124,12 @@ template<class T> bool operator!=(const tag_array<T>& lhs, const tag_array<T>& r
//Typedefs that should be used instead of the template tag_array.
typedef tag_array<int8_t> tag_byte_array;
typedef tag_array<int32_t> tag_int_array;
+typedef tag_array<int64_t> tag_long_array;
//Explicit instantiations
template class NBT_EXPORT tag_array<int8_t>;
template class NBT_EXPORT tag_array<int32_t>;
+template class NBT_EXPORT tag_array<int64_t>;
}
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<tag_list> init);
tag_list(std::initializer_list<tag_compound> init);
tag_list(std::initializer_list<tag_int_array> init);
+ tag_list(std::initializer_list<tag_long_array> 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 T> class tag_array;
typedef tag_array<int8_t> tag_byte_array;
typedef tag_array<int32_t> tag_int_array;
+typedef tag_array<int64_t> tag_long_array;
class tag_list;
class tag_compound;