From 395e262e3ecd22ffceaed1a18d4ce99a5f23d04f Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 3 Feb 2022 00:38:18 -0600 Subject: [PATCH] [ox/mc] Add writer fieldString function --- deps/ox/src/ox/mc/write.cpp | 4 ++++ deps/ox/src/ox/mc/write.hpp | 2 ++ deps/ox/src/ox/oc/write.hpp | 2 ++ 3 files changed, 8 insertions(+) diff --git a/deps/ox/src/ox/mc/write.cpp b/deps/ox/src/ox/mc/write.cpp index 715c2db3..dc1af3ad 100644 --- a/deps/ox/src/ox/mc/write.cpp +++ b/deps/ox/src/ox/mc/write.cpp @@ -90,6 +90,10 @@ Error MetalClawWriter::field(const char*, SerStr val) noexcept { return OxError(0); } +Error MetalClawWriter::fieldCString(const char *name, char **val, int len) noexcept { + return field(name, SerStr(val, len)); +} + std::size_t MetalClawWriter::size() const noexcept { return m_buffIt; } diff --git a/deps/ox/src/ox/mc/write.hpp b/deps/ox/src/ox/mc/write.hpp index 029725ed..620abb43 100644 --- a/deps/ox/src/ox/mc/write.hpp +++ b/deps/ox/src/ox/mc/write.hpp @@ -68,6 +68,8 @@ class MetalClawWriter { Error field(const char*, SerStr val) noexcept; + Error fieldCString(const char *name, char **val, int len) noexcept; + template Error field(const char*, T *val) noexcept; diff --git a/deps/ox/src/ox/oc/write.hpp b/deps/ox/src/ox/oc/write.hpp index dc912ad9..1073238b 100644 --- a/deps/ox/src/ox/oc/write.hpp +++ b/deps/ox/src/ox/oc/write.hpp @@ -63,6 +63,8 @@ class OrganicClawWriter { Error field(const char*, SerStr val) noexcept; + Error fieldCString(const char *name, char **val, int len) noexcept; + template Error field(const char*, T *val) noexcept;