Added wxMemoryBuffer::Clear() and IsEmpty() methods.
Add two convenient methods which may be used instead of testing or setting the buffer length. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -535,6 +535,8 @@ public:
|
||||
size_t GetBufSize() const { return m_bufdata->m_size; }
|
||||
size_t GetDataLen() const { return m_bufdata->m_len; }
|
||||
|
||||
bool IsEmpty() const { return GetDataLen() == 0; }
|
||||
|
||||
void SetBufSize(size_t size) { m_bufdata->ResizeIfNeeded(size); }
|
||||
void SetDataLen(size_t len)
|
||||
{
|
||||
@@ -542,6 +544,8 @@ public:
|
||||
m_bufdata->m_len = len;
|
||||
}
|
||||
|
||||
void Clear() { SetDataLen(0); }
|
||||
|
||||
// Ensure the buffer is big enough and return a pointer to it
|
||||
void *GetWriteBuf(size_t sizeNeeded)
|
||||
{
|
||||
|
Reference in New Issue
Block a user