From: Vadim Zeitlin Date: Sat, 1 Apr 2006 02:58:56 +0000 (+0000) Subject: added extend() method which realloc()s the buffer X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6901ac371fdedbd206ba0eee5f5d3e47ffbf9663 added extend() method which realloc()s the buffer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/buffer.h b/include/wx/buffer.h index bd02a935db..1c54c50404 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -84,6 +84,18 @@ public: \ return *this; \ } \ \ + bool extend(size_t len) \ + { \ + chartype * \ + str = (chartype *)realloc(m_str, (len + 1)*sizeof(chartype)); \ + if ( !str ) \ + return false; \ + \ + m_str = str; \ + \ + return true; \ + } \ + \ chartype *data() { return m_str; } \ const chartype *data() const { return m_str; } \ operator const chartype *() const { return m_str; } \