wxmemorybuffera wxmemorybuffer is a useful data structure for storing arbitrary sized blocks of memory. wxmemorybuffer guarantees deletion of the memory block when the object is destroyed. derived from none include files <wx/buffer.h> members
wxmemorybuffer::wxmemorybuffer
wxmemorybuffer::wxmemorybufferwxmemorybuffer(const wxmemorybuffer& src) copy constructor, refcounting is used for performance , but wxmemorybuffer is not a copy-on-write structure so changes made to one buffer effect all copies made from it. wxmemorybuffer(size_t size) create a new buffer. size
wxmemorybuffer::getdatavoid* getdata() return a pointer to the data in the buffer.
wxmemorybuffer::getbufsizesize_t getbufsize() returns the size of the buffer.
wxmemorybuffer::getdatalensize_t getdatalen() returns the length of the valid data in the buffer.
wxmemorybuffer::setbufsizevoid setbufsize(size_t size) ensures the buffer has at least size bytes available.
wxmemorybuffer::setdatalenvoid setdatalen(size_t size) sets the length of the data stored in the buffer. mainly useful for truncating existing data. size
wxmemorybuffer::getwritebufvoid * getwritebuf(size_t sizeneeded) ensure the buffer is big enough and return a pointer to the buffer which can be used to directly write into the buffer up to sizeneeded bytes.
wxmemorybuffer::ungetwritebufvoid ungetwritebuf(size_t sizeused) update the buffer after completing a direct write, which you must have used getwritebuf() to initialise. sizeused
wxmemorybuffer::getappendbufvoid * getappendbuf(size_t sizeneeded) ensure that the buffer is big enough and return a pointer to the start of the empty space in the buffer. this pointer can be used to directly write data into the buffer, this new data will be appended to the existing data. sizeneeded
wxmemorybuffer::ungetappendbufvoid ungetappendbuf(size_t sizeused) update the length after completing a direct append, which you must have used getappendbuf() to initialise. sizeused
wxmemorybuffer::appendbytevoid appendbyte(char data) append a single byte to the buffer. data
wxmemorybuffer::appenddatavoid appenddata(void* data, size_t len) single call to append a data block to the buffer. data
|