X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d739313fc00b84e87b962a430c9c6622e88d81c1..7332adf0354fe6d7066483f8610e42380abbde41:/include/wx/string.h diff --git a/include/wx/string.h b/include/wx/string.h index 31a9a2b30c..6c035428b1 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -1035,6 +1035,8 @@ public: size_t Add(const wxString& str); // add new element at given position void Insert(const wxString& str, size_t uiIndex); + // expand the array to have count elements + void SetCount(size_t count); // remove first item matching this value void Remove(const wxChar *sz); // remove item by index @@ -1080,6 +1082,25 @@ public: { Copy(array); } }; +// ---------------------------------------------------------------------------- +// wxStringBuffer: a tiny class allowing to get a writable pointer into string +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxStringBuffer +{ +public: + wxStringBuffer(wxString& str, size_t lenWanted = 1024) + : m_str(str) { m_buf = m_str.GetWriteBuf(lenWanted); } + + ~wxStringBuffer() { m_str.UngetWriteBuf(); } + + operator wxChar*() const { return m_buf; } + +private: + wxString& m_str; + wxChar *m_buf; +}; + // --------------------------------------------------------------------------- // wxString comparison functions: operator versions are always case sensitive // ---------------------------------------------------------------------------