Chapter 5. WvBuffer - dynamically-resizing binary buffers

A WvBuffer is a dynamically-sized buffer. It's often perfect for storing streamed data.

WvBuffer is pretty simple to use. You can write data to it using put() and retrieve the data using get(). get() effectively deletes the data from the buffer, but you can use unget() to get it back if you haven't done any buffer operations in the meantime.

WvBuffer buf;
buf.put("borkle borkle\n");
printf(buf.get(14));
buf.unget(14);
printf(buf.get(14));

The above code will print "borkle borkle" twice.

WvBuffers also have interesting functions to let you find characters, merge WvBuffers, and get entire strings. wvbuffer.h documents these functions and more.

WvBufferStore - basic buffer storage class

x