X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/526954c5968baa29218c994ec48e476ae2bd4b9f..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/buffer.h?ds=sidebyside diff --git a/interface/wx/buffer.h b/interface/wx/buffer.h index 1729dd98b0..8ab9dce8aa 100644 --- a/interface/wx/buffer.h +++ b/interface/wx/buffer.h @@ -2,7 +2,6 @@ // Name: buffer.h // Purpose: interface of wxMemoryBuffer // Author: wxWidgets team -// RCS-ID: $Id$ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -178,7 +177,7 @@ public: wxCharTypeBuffer(const wxScopedCharTypeBuffer& src); /** - Assigns @a str to this buffer and takes ownership of it (i.e. the + Assigns @a str to this buffer and takes ownership of it (i.e.\ the buffer becomes "owned"). */ wxCharTypeBuffer& operator=(const CharType *str); @@ -287,9 +286,9 @@ public: Create a new buffer. @param size - size of the new buffer. + size of the new buffer, 1KiB by default. */ - wxMemoryBuffer(size_t size = DefBufSize); + wxMemoryBuffer(size_t size = 1024); /** Append a single byte to the buffer. @@ -299,6 +298,27 @@ public: */ void AppendByte(char data); + /** + Single call to append a data block to the buffer. + + @param data + Pointer to block to append to the buffer. + @param len + Length of data to append. + */ + void AppendData(const void *data, size_t len); + + /** + Clear the buffer contents. + + The buffer won't contain any data after this method is called. + + @see IsEmpty() + + @since 2.9.4 + */ + void Clear(); + /** 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 @@ -333,6 +353,15 @@ public: */ void* GetWriteBuf(size_t sizeNeeded); + /** + Returns true if the buffer contains no data. + + @see Clear() + + @since 2.9.4 + */ + bool IsEmpty() const; + /** Ensures the buffer has at least @a size bytes available. */