[ox/std] Remove raw char* CharBufferWriter constructor

This commit is contained in:
Gary Talent 2024-11-26 20:46:43 -06:00
parent cb55b31afa
commit e13c6e812b
4 changed files with 3 additions and 6 deletions

View File

@ -395,7 +395,7 @@ Result<Buffer> writeMC(auto const&val, std::size_t buffReserveSz = 2 * units::KB
} }
Error writeMC(char *buff, std::size_t buffLen, auto const&val, std::size_t *sizeOut = nullptr) noexcept { Error writeMC(char *buff, std::size_t buffLen, auto const&val, std::size_t *sizeOut = nullptr) noexcept {
CharBuffWriter bw(buff, buffLen); CharBuffWriter bw{{buff, buffLen}};
oxReturnError(writeMC(bw, val)); oxReturnError(writeMC(bw, val));
if (sizeOut) { if (sizeOut) {
*sizeOut = bw.tellp(); *sizeOut = bw.tellp();

View File

@ -105,9 +105,6 @@ class CharBuffWriter {
m_buff(buff.data()) { m_buff(buff.data()) {
} }
explicit constexpr CharBuffWriter(char *buff, std::size_t size) noexcept: m_cap(size), m_buff(buff) {
}
constexpr ox::Error seekp(std::size_t p) noexcept { constexpr ox::Error seekp(std::size_t p) noexcept {
m_it = p; m_it = p;
return {}; return {};

View File

@ -263,7 +263,7 @@ constexpr auto itoa(Integer v) noexcept {
}(); }();
ox::IString<Cap> out; ox::IString<Cap> out;
std::ignore = out.resize(out.cap()); std::ignore = out.resize(out.cap());
ox::CharBuffWriter w(out.data(), out.cap()); ox::CharBuffWriter w{{out.data(), out.cap()}};
std::ignore = writeItoa(v, w); std::ignore = writeItoa(v, w);
std::ignore = out.resize(w.tellp()); std::ignore = out.resize(w.tellp());
return out; return out;

View File

@ -187,7 +187,7 @@ class UUID {
constexpr UUIDStr toString() const noexcept { constexpr UUIDStr toString() const noexcept {
UUIDStr out; UUIDStr out;
std::ignore = out.resize(UUIDStr::cap()); std::ignore = out.resize(UUIDStr::cap());
ox::CharBuffWriter bw(out.data(), UUIDStr::cap()); ox::CharBuffWriter bw{{out.data(), UUIDStr::cap()}};
std::ignore = toString(bw); std::ignore = toString(bw);
out[UUIDStr::cap()] = 0; out[UUIDStr::cap()] = 0;
return out; return out;