From: Robin Dunn Date: Mon, 31 Jan 2000 21:22:44 +0000 (+0000) Subject: Minor additions to make working with binary buffers easier. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8f06a017120fd765296f7e8cde414edea64153a9?ds=inline Minor additions to make working with binary buffers easier. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/string.h b/include/wx/string.h index bbe4d0cce7..1b0c138ea9 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -520,6 +520,8 @@ public: // append count copies of given character wxString& Append(wxChar ch, size_t count = 1u) { wxString str(ch, count); return *this << str; } + wxString& Append(const wxChar* psz, size_t nLen) + { ConcatSelf(nLen, psz); return *this; } // prepend a string, return the string itself wxString& Prepend(const wxString& str) @@ -668,6 +670,7 @@ public: wxChar *GetWriteBuf(size_t nLen); // call this immediately after GetWriteBuf() has been used void UngetWriteBuf(); + void UngetWriteBuf(size_t nLen); // wxWindows version 1 compatibility functions diff --git a/src/common/string.cpp b/src/common/string.cpp index fd6ee0a780..559bf3311f 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -528,6 +528,12 @@ void wxString::UngetWriteBuf() GetStringData()->Validate(TRUE); } +void wxString::UngetWriteBuf(size_t nLen) +{ + GetStringData()->nDataLength = nLen; + GetStringData()->Validate(TRUE); +} + // --------------------------------------------------------------------------- // data access // ---------------------------------------------------------------------------