added wxStringBuffer helper

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12804 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-12-01 17:16:16 +00:00
parent f2d0790b1a
commit 1d21855083
2 changed files with 73 additions and 0 deletions

View File

@@ -1082,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
// ---------------------------------------------------------------------------