diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-07-15 18:04:46 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-07-15 18:04:46 +0200 |
| commit | 6fb5d9850e0fb08c3cd7bdb7dd4f60a03dd0a948 (patch) | |
| tree | 78549efddaf0f68a69a1b979ba80c6ed01d5d303 | |
| parent | f198ab5fbf31c107e82e05969ea72abb8872fc11 (diff) | |
| download | Project-Tick-6fb5d9850e0fb08c3cd7bdb7dd4f60a03dd0a948.tar.gz Project-Tick-6fb5d9850e0fb08c3cd7bdb7dd4f60a03dd0a948.zip | |
Put tag forward declarations in separate header
| -rw-r--r-- | include/tag_list.h | 8 | ||||
| -rw-r--r-- | include/tagfwd.h | 48 |
2 files changed, 49 insertions, 7 deletions
diff --git a/include/tag_list.h b/include/tag_list.h index d34ca83b20..a84e010f04 100644 --- a/include/tag_list.h +++ b/include/tag_list.h @@ -21,6 +21,7 @@ #define TAG_LIST_H_INCLUDED #include "crtp_tag.h" +#include "tagfwd.h" #include "value.h" #include <typeinfo> #include <vector> @@ -28,13 +29,6 @@ namespace nbt { -//Forward declarations -class tag_list; -class tag_compound; -template<class T> class tag_array; -typedef tag_array<int8_t> tag_byte_array; -typedef tag_array<int32_t> tag_int_array; - ///Tag that contains multiple unnamed tags of the same type class tag_list final : public detail::crtp_tag<tag_list> { diff --git a/include/tagfwd.h b/include/tagfwd.h new file mode 100644 index 0000000000..98d75b8328 --- /dev/null +++ b/include/tagfwd.h @@ -0,0 +1,48 @@ +/* + * libnbt++ - A library for the Minecraft Named Binary Tag format. + * Copyright (C) 2013, 2015 ljfa-ag + * + * This file is part of libnbt++. + * + * libnbt++ is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libnbt++ is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libnbt++. If not, see <http://www.gnu.org/licenses/>. + */ +/** @file + * @brief Provides forward declarations for all tag classes + */ +#ifndef TAGFWD_H_INCLUDED +#define TAGFWD_H_INCLUDED + +namespace nbt +{ + +class tag; + +template<class T> class tag_primitive; +typedef tag_primitive<int8_t> tag_byte; +typedef tag_primitive<int16_t> tag_short; +typedef tag_primitive<int32_t> tag_int; +typedef tag_primitive<int64_t> tag_long; +typedef tag_primitive<float> tag_float; +typedef tag_primitive<double> tag_double; + +template<class T> class tag_array; +typedef tag_array<int8_t> tag_byte_array; +typedef tag_array<int32_t> tag_int_array; + +class tag_list; +class tag_compound; + +} + +#endif // TAGFWD_H_INCLUDED |
