From d17f536832aa925eb21c344a3ba5570fa519f9c9 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 13 Feb 2023 21:35:37 -0600 Subject: [PATCH] [ox/std] Add write(Writer_c, StringView) --- deps/ox/src/ox/std/stringview.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deps/ox/src/ox/std/stringview.hpp b/deps/ox/src/ox/std/stringview.hpp index 652a4a86..978ac32f 100644 --- a/deps/ox/src/ox/std/stringview.hpp +++ b/deps/ox/src/ox/std/stringview.hpp @@ -17,6 +17,7 @@ #include "strops.hpp" #include "types.hpp" #include "vector.hpp" +#include "writer.hpp" namespace ox { @@ -340,6 +341,10 @@ constexpr ox::Vector split(CRStringView str, CRStringVi return out; } +constexpr auto write(Writer_c auto *writer, ox::CRStringView sv) noexcept { + return writer->write(sv.data(), sv.bytes()); +} + #ifdef OX_USE_STDLIB constexpr auto toStdStringView(CRStringView sv) noexcept { return std::string_view(sv.data(), sv.bytes());