From 92dd084fdd7f44d7aba88424134d97e3eceb3b0f Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Wed, 5 Aug 2015 13:50:30 +0200 Subject: Implement stream_reader::read_payload --- include/io/stream_reader.h | 1 + include/tag.h | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/io/stream_reader.h b/include/io/stream_reader.h index 07eb36192d..056d14e9dd 100644 --- a/include/io/stream_reader.h +++ b/include/io/stream_reader.h @@ -23,6 +23,7 @@ #include "endian_str.h" #include "tag.h" #include +#include #include namespace nbt diff --git a/include/tag.h b/include/tag.h index ae84891c76..4b547e013c 100644 --- a/include/tag.h +++ b/include/tag.h @@ -51,6 +51,10 @@ enum class tag_type : int8_t */ bool is_valid_type(int type, bool allow_end = false); +//Forward declaration +namespace io +{ class stream_reader; } + ///Base class for all NBT tag classes class tag { @@ -72,6 +76,9 @@ public: */ virtual tag& assign(tag&& rhs) = 0; + ///Reads the tag's payload from the stream + virtual void read_payload(io::stream_reader& reader) = 0; + /** * @brief Default-constructs a new tag of the given type * @throw std::invalid_argument if the type is not valid (e.g. End or Null) -- cgit 0.0.5-2-1-g0f52