#include <wx/buffer.h>
Public Member Functions | |
| wxMemoryBuffer (const wxMemoryBuffer &src) | |
| wxMemoryBuffer (size_t size=DefBufSize) | |
| void | AppendByte (char data) |
| void * | GetAppendBuf (size_t sizeNeeded) |
| size_t | GetBufSize () const |
| void * | GetData () const |
| size_t | GetDataLen () const |
| void * | GetWriteBuf (size_t sizeNeeded) |
| void | SetBufSize (size_t size) |
| void | SetDataLen (size_t size) |
| void | UngetAppendBuf (size_t sizeUsed) |
| void | UngetWriteBuf (size_t sizeUsed) |
| wxMemoryBuffer::wxMemoryBuffer | ( | 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::wxMemoryBuffer | ( | size_t | size = DefBufSize |
) |
Create a new buffer.
| size | size of the new buffer. |
| void wxMemoryBuffer::AppendByte | ( | char | data | ) |
Append a single byte to the buffer.
| data | New byte to append to the buffer. |
| void* wxMemoryBuffer::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 | Amount of extra space required in the buffer for the append operation |
| size_t wxMemoryBuffer::GetBufSize | ( | ) | const |
Returns the size of the buffer.
| void* wxMemoryBuffer::GetData | ( | ) | const |
Return a pointer to the data in the buffer.
| size_t wxMemoryBuffer::GetDataLen | ( | ) | const |
Returns the length of the valid data in the buffer.
| void* wxMemoryBuffer::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.
| void wxMemoryBuffer::SetBufSize | ( | size_t | size | ) |
Ensures the buffer has at least size bytes available.
| void wxMemoryBuffer::SetDataLen | ( | size_t | size | ) |
Sets the length of the data stored in the buffer. Mainly useful for truncating existing data.
| size | New length of the valid data in the buffer. This is distinct from the allocated size |
| void wxMemoryBuffer::UngetAppendBuf | ( | size_t | sizeUsed | ) |
Update the length after completing a direct append, which you must have used GetAppendBuf() to initialise.
| sizeUsed | This is the amount of new data that has been appended. |
| void wxMemoryBuffer::UngetWriteBuf | ( | size_t | sizeUsed | ) |
Update the buffer after completing a direct write, which you must have used GetWriteBuf() to initialise.
| sizeUsed | The amount of data written in to buffer by the direct write |
|
[ top ] |