2 #include <msp/strings/format.h>
15 void Buffer::storage(unsigned sz)
20 throw incompatible_data("Buffer::storage");
24 throw invalid_argument("Buffer::storage");
31 void Buffer::data(const void *d)
33 return sub_data(0, size, d);
36 void Buffer::sub_data(unsigned off, unsigned sz, const void *d)
39 throw invalid_operation("Buffer::sub_data");
41 BufferBackend::sub_data(off, sz, d);
44 void Buffer::require_size(unsigned req_sz) const
47 throw buffer_too_small(format("buffer has %d bytes; %d required", size, req_sz));