X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fedde9b906cccc1bf8c130706dd1bc28eff66aea..67393addd823ea1a9b653a93c8554e7fd013ecfa:/include/wx/buffer.h?ds=inline diff --git a/include/wx/buffer.h b/include/wx/buffer.h index bd02a935db..f17aa0c1ab 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -64,6 +64,12 @@ public: \ return p; \ } \ \ + void reset() \ + { \ + free(m_str); \ + m_str = NULL; \ + } \ + \ classname(const classname& src) \ : m_str(src.release()) \ { \ @@ -84,6 +90,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; } \ @@ -104,11 +122,15 @@ DEFINE_BUFFER(wxWCharBuffer, wchar_t, wxStrdupW); #undef DEFINE_BUFFER #if wxUSE_UNICODE + typedef wxWCharBuffer wxWxCharBuffer; + #define wxMB2WXbuf wxWCharBuffer #define wxWX2MBbuf wxCharBuffer #define wxWC2WXbuf wxChar* #define wxWX2WCbuf wxChar* #else // ANSI + typedef wxCharBuffer wxWxCharBuffer; + #define wxMB2WXbuf wxChar* #define wxWX2MBbuf wxChar* #define wxWC2WXbuf wxCharBuffer