diff --git a/deps/ox/src/ox/claw/CMakeLists.txt b/deps/ox/src/ox/claw/CMakeLists.txt index 65519a9c..bab204df 100644 --- a/deps/ox/src/ox/claw/CMakeLists.txt +++ b/deps/ox/src/ox/claw/CMakeLists.txt @@ -2,6 +2,7 @@ add_library( OxClaw read.cpp + write.cpp ) target_link_libraries( diff --git a/deps/ox/src/ox/claw/write.hpp b/deps/ox/src/ox/claw/write.hpp index 5c1968bb..0dc60d91 100644 --- a/deps/ox/src/ox/claw/write.hpp +++ b/deps/ox/src/ox/claw/write.hpp @@ -43,6 +43,16 @@ template return -1; } +template +struct type_version { + static constexpr auto value = -1; +}; + +template +struct type_version { + static constexpr auto value = T::TypeVersion; +}; + template constexpr const char *getTypeName(T *t) noexcept { TypeInfoCatcher tnc; @@ -65,7 +75,7 @@ ValErr writeClawHeader(T *t, ClawFormat fmt) noexcept { } out += detail::getTypeName(t); out += ";"; - const auto tn = detail::getTypeVersion(t); + const auto tn = detail::type_version::value; if (tn > -1) { out += tn; } @@ -76,7 +86,7 @@ ValErr writeClawHeader(T *t, ClawFormat fmt) noexcept { } template -constexpr ValErr> writeClaw(T *t, ClawFormat fmt) { +ValErr> writeClaw(T *t, ClawFormat fmt) { auto [header, headerErr] = detail::writeClawHeader(t, fmt); oxReturnError(headerErr); const auto [data, dataErr] = fmt == ClawFormat::Metal ? writeMC(t) : writeOC(t);