From b6d496b1e83853cd272a8ffdea273c59bbf4b87c Mon Sep 17 00:00:00 2001 From: YongDo-Hyun Date: Sat, 27 Dec 2025 13:05:30 +0300 Subject: feat: add numeric tag creation methods and corresponding tests for value assignments Signed-off-by: YongDo-Hyun --- include/tag.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/tag.h b/include/tag.h index 0cb3c82c95..ac3b49fa3a 100644 --- a/include/tag.h +++ b/include/tag.h @@ -123,6 +123,16 @@ public: * @throw std::invalid_argument if the type is not valid (e.g. End or Null) */ static std::unique_ptr create(tag_type type); + /** + * @brief Constructs a numeric tag of the given type and value + * @throw std::invalid_argument if the type is not numeric + */ + static std::unique_ptr create(tag_type type, int8_t val); + static std::unique_ptr create(tag_type type, int16_t val); + static std::unique_ptr create(tag_type type, int32_t val); + static std::unique_ptr create(tag_type type, int64_t val); + static std::unique_ptr create(tag_type type, float val); + static std::unique_ptr create(tag_type type, double val); friend NBT_EXPORT bool operator==(const tag& lhs, const tag& rhs); friend NBT_EXPORT bool operator!=(const tag& lhs, const tag& rhs); -- cgit 0.0.5-2-1-g0f52