[ox/std] Remove raw char* CharBufferWriter constructor
This commit is contained in:
parent
cb55b31afa
commit
e13c6e812b
2
deps/ox/src/ox/mc/write.hpp
vendored
2
deps/ox/src/ox/mc/write.hpp
vendored
@ -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();
|
||||||
|
3
deps/ox/src/ox/std/buffer.hpp
vendored
3
deps/ox/src/ox/std/buffer.hpp
vendored
@ -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 {};
|
||||||
|
2
deps/ox/src/ox/std/istring.hpp
vendored
2
deps/ox/src/ox/std/istring.hpp
vendored
@ -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;
|
||||||
|
2
deps/ox/src/ox/std/uuid.hpp
vendored
2
deps/ox/src/ox/std/uuid.hpp
vendored
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user