diff --git a/apps/esmtool/labels.cpp b/apps/esmtool/labels.cpp index d88a608466..5f2026b724 100644 --- a/apps/esmtool/labels.cpp +++ b/apps/esmtool/labels.cpp @@ -986,4 +986,4 @@ std::string recordFlags(uint32_t flags) properties += "Invalid "; properties += Misc::StringUtils::format("(0x%08X)", flags); return properties; -} \ No newline at end of file +} diff --git a/apps/esmtool/tes4.cpp b/apps/esmtool/tes4.cpp index 3c7d03e67b..6b13aa705c 100644 --- a/apps/esmtool/tes4.cpp +++ b/apps/esmtool/tes4.cpp @@ -97,6 +97,10 @@ namespace EsmTool std::cout << "\n Id: " << value.mId; if constexpr (ESM4::hasFlags) std::cout << "\n Record flags: " << recordFlags(value.mFlags); + if constexpr (ESM4::hasParentFormId) + std::cout << "\n ParentFormId: " << value.mParentFormId; + if constexpr (ESM4::hasParent) + std::cout << "\n Parent: " << value.mParent; if constexpr (ESM4::hasEditorId) std::cout << "\n EditorId: " << value.mEditorId; if constexpr (ESM4::hasModel) @@ -105,6 +109,10 @@ namespace EsmTool std::cout << "\n Nif:" << WriteArray("\n - ", value.mNif); if constexpr (ESM4::hasKf) std::cout << "\n Kf:" << WriteArray("\n - ", value.mKf); + if constexpr (ESM4::hasType) + std::cout << "\n Type: " << value.mType; + if constexpr (ESM4::hasValue) + std::cout << "\n Value: " << value.mValue; std::cout << '\n'; } diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 405c36b18e..89188215e8 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -194,6 +194,7 @@ add_component_dir (esm4 reference script readerutils + typetraits ) add_component_dir (misc diff --git a/components/esm4/readerutils.hpp b/components/esm4/readerutils.hpp index dd202a5f71..541568d3d2 100644 --- a/components/esm4/readerutils.hpp +++ b/components/esm4/readerutils.hpp @@ -81,4 +81,4 @@ namespace ESM4 }; } -#endif // !OPENMW_COMPONENTS_ESM4_READERUTILS +#endif // OPENMW_COMPONENTS_ESM4_READERUTILS diff --git a/components/esm4/typetraits.hpp b/components/esm4/typetraits.hpp index 65e56e891d..95e6f607e6 100644 --- a/components/esm4/typetraits.hpp +++ b/components/esm4/typetraits.hpp @@ -31,6 +31,32 @@ namespace ESM4 template inline constexpr bool hasId = HasId::value; + template > + struct HasParentFormId : std::false_type + { + }; + + template + struct HasParentFormId> : std::true_type + { + }; + + template + inline constexpr bool hasParentFormId = HasParentFormId::value; + + template > + struct HasParent : std::false_type + { + }; + + template + struct HasParent> : std::true_type + { + }; + + template + inline constexpr bool hasParent = HasParent::value; + template > struct HasFlags : std::false_type { @@ -95,6 +121,32 @@ namespace ESM4 template inline constexpr bool hasKf = HasKf::value; + + template > + struct HasType : std::false_type + { + }; + + template + struct HasType> : std::true_type + { + }; + + template + inline constexpr bool hasType = HasType::value; + + template > + struct HasValue : std::false_type + { + }; + + template + struct HasValue> : std::true_type + { + }; + + template + inline constexpr bool hasValue = HasValue::value; } #endif // OPENMW_COMPONENTS_ESM4_TYPETRAITS