diff --git a/deps/ox/src/ox/mc/write.hpp b/deps/ox/src/ox/mc/write.hpp index 9d3de41e..68576366 100644 --- a/deps/ox/src/ox/mc/write.hpp +++ b/deps/ox/src/ox/mc/write.hpp @@ -76,10 +76,12 @@ class MetalClawWriter { template constexpr Error field(const char*, BString *val) noexcept; - constexpr Error fieldCString(const char *name, const char **val, std::size_t buffLen) noexcept; + constexpr Error fieldCString(const char *name, const char *const*val, std::size_t buffLen) noexcept; constexpr Error fieldCString(const char *name, const char **val) noexcept; + constexpr Error fieldCString(const char *name, const char *const*val) noexcept; + constexpr Error fieldCString(const char *name, const char *val, std::size_t len) noexcept; constexpr Error fieldCString(const char *name, char **val, std::size_t buffLen) noexcept { @@ -223,7 +225,7 @@ constexpr Error MetalClawWriter::field(const char *name, BString *val) noexce return fieldCString(name, val->data(), val->cap()); } -constexpr Error MetalClawWriter::fieldCString(const char*, const char **val, std::size_t) noexcept { +constexpr Error MetalClawWriter::fieldCString(const char*, const char *const*val, std::size_t) noexcept { bool fieldSet = false; if (m_unionIdx == -1 || m_unionIdx == m_field) { const auto strLen = *val ? ox_strlen(*val) : 0; @@ -249,6 +251,10 @@ constexpr Error MetalClawWriter::fieldCString(const char *name, const char **val return fieldCString(name, val, {}); } +constexpr Error MetalClawWriter::fieldCString(const char *name, const char *const*val) noexcept { + return fieldCString(name, val, {}); +} + constexpr Error MetalClawWriter::fieldCString(const char*, const char *val, std::size_t strLen) noexcept { bool fieldSet = false; if (strLen && (m_unionIdx == -1 || m_unionIdx == m_field)) { diff --git a/deps/ox/src/ox/model/modelhandleradaptor.hpp b/deps/ox/src/ox/model/modelhandleradaptor.hpp index 1499176b..2c5d0fd9 100644 --- a/deps/ox/src/ox/model/modelhandleradaptor.hpp +++ b/deps/ox/src/ox/model/modelhandleradaptor.hpp @@ -43,6 +43,10 @@ class ModelHandlerInterface { return m_handler->fieldCString(name, val); } + constexpr Error fieldCString(const char *name, const char *const*val) noexcept { + return m_handler->fieldCString(name, val); + } + constexpr Error fieldCString(const char *name, const char **val) noexcept { return m_handler->fieldCString(name, val); } diff --git a/deps/ox/src/ox/oc/write.cpp b/deps/ox/src/ox/oc/write.cpp index 2b8af429..52daa63b 100644 --- a/deps/ox/src/ox/oc/write.cpp +++ b/deps/ox/src/ox/oc/write.cpp @@ -26,7 +26,7 @@ Error OrganicClawWriter::field(const char *key, SerStr val) noexcept { return OxError(0); } -Error OrganicClawWriter::fieldCString(const char *key, const char **val, int len) noexcept { +Error OrganicClawWriter::fieldCString(const char *key, const char *const*val, int len) noexcept { if (targetValid() && len) { value(key) = *val; } @@ -38,7 +38,7 @@ Error OrganicClawWriter::fieldCString(const char *key, char **val, int len) noex return fieldCString(key, const_cast(val), len); } -Error OrganicClawWriter::fieldCString(const char *key, const char **val) noexcept { +Error OrganicClawWriter::fieldCString(const char *key, const char *const*val) noexcept { return fieldCString(key, const_cast(val), {}); } diff --git a/deps/ox/src/ox/oc/write.hpp b/deps/ox/src/ox/oc/write.hpp index 0199b877..efe816b9 100644 --- a/deps/ox/src/ox/oc/write.hpp +++ b/deps/ox/src/ox/oc/write.hpp @@ -164,11 +164,11 @@ class OrganicClawWriter { Error field(const char*, SerStr val) noexcept; - Error fieldCString(const char*, const char **val, int len) noexcept; + Error fieldCString(const char*, const char *const*val, int len) noexcept; Error fieldCString(const char *name, char **val, int len) noexcept; - Error fieldCString(const char *name, const char **val) noexcept; + Error fieldCString(const char *name, const char *const*val) noexcept; Error fieldCString(const char *name, char **val) noexcept;