[ox] Make StringView write function take a Writer_c reference
This commit is contained in:
parent
b2103e558e
commit
b67359ddb0
6
deps/ox/src/ox/claw/write.hpp
vendored
6
deps/ox/src/ox/claw/write.hpp
vendored
@ -76,15 +76,15 @@ template<typename T>
|
||||
ox::Error writeClawHeader(Writer_c auto &writer, const T *t, ClawFormat fmt) noexcept {
|
||||
switch (fmt) {
|
||||
case ClawFormat::Metal:
|
||||
oxReturnError(write(&writer, "M2;"));
|
||||
oxReturnError(write(writer, "M2;"));
|
||||
break;
|
||||
case ClawFormat::Organic:
|
||||
oxReturnError(write(&writer, "O1;"));
|
||||
oxReturnError(write(writer, "O1;"));
|
||||
break;
|
||||
default:
|
||||
return OxError(1);
|
||||
}
|
||||
oxReturnError(write(&writer, detail::getTypeName(t)));
|
||||
oxReturnError(write(writer, detail::getTypeName(t)));
|
||||
oxReturnError(writer.put(';'));
|
||||
const auto tn = detail::getTypeVersion(t);
|
||||
if (tn > -1) {
|
||||
|
4
deps/ox/src/ox/std/stringview.hpp
vendored
4
deps/ox/src/ox/std/stringview.hpp
vendored
@ -341,8 +341,8 @@ constexpr ox::Vector<ox::StringView, smallSz> split(CRStringView str, CRStringVi
|
||||
return out;
|
||||
}
|
||||
|
||||
constexpr auto write(Writer_c auto *writer, ox::CRStringView sv) noexcept {
|
||||
return writer->write(sv.data(), sv.bytes());
|
||||
constexpr auto write(Writer_c auto &writer, ox::CRStringView sv) noexcept {
|
||||
return writer.write(sv.data(), sv.bytes());
|
||||
}
|
||||
|
||||
#ifdef OX_USE_STDLIB
|
||||
|
Loading…
Reference in New Issue
Block a user