59 using size_type = BaseBuffer::size_type;
60 using pos_type = BaseBuffer::pos_type;
61 using offset_type = BaseBuffer::offset_type;
75 return write(&t,
sizeof(t));
78 WriteBuffer& write(
void const* src, size_type count);
80 WriteBuffer& write(std::istream& in, size_type count);
83 void writeAt(pos_type pos, T
const& t)
85 writeAt(pos, &t,
sizeof(t));
88 void writeAt(pos_type pos,
void const* src, size_type count);
90 void writeAt(pos_type pos, std::istream& in, size_type count);
93 void writeAt(offset_type off, IODir dir, T
const& t)
95 writeAt(off, dir, &t,
sizeof(t));
98 void writeAt(offset_type off, IODir dir,
void const* src, size_type count);
100 void writeAt(offset_type off, IODir dir, std::istream& in, size_type count);
102 void reserve(size_type new_cap);
104 virtual void clear();
106 [[nodiscard]] std::byte* data();
108 [[nodiscard]] size_type capacity()
const noexcept;
110 [[nodiscard]] pos_type writePos()
const noexcept;
114 WriteBuffer& writeSeek(offset_type off, IODir dir)
noexcept;
117 WriteBuffer& writeSeek(T
const& t, pos_type count)
noexcept
119 return writeSeek(
sizeof(t) * count);
123 WriteBuffer& writeSeek(T
const& t, offset_type count_signed, IODir dir)
noexcept
125 return writeSeek(
sizeof(t) * count_signed, dir);
128 [[nodiscard]] size_type writeLeft()
const noexcept;
132 void operator()(
void* p)
const noexcept { std::free(p); }
135 std::unique_ptr<std::byte, FreeDeleter> data_;