[ox] Make StringView write function take a Writer_c reference

This commit is contained in:
Gary Talent 2023-06-09 21:14:28 -05:00
parent b2103e558e
commit b67359ddb0
2 changed files with 5 additions and 5 deletions

View File

@ -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) {

View File

@ -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