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
This commit is contained in:
Robin Dunn 2000-01-31 21:22:44 +00:00
parent eec92d76f8
commit 8f06a01712
2 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -528,6 +528,12 @@ void wxString::UngetWriteBuf()
GetStringData()->Validate(TRUE);
}
void wxString::UngetWriteBuf(size_t nLen)
{
GetStringData()->nDataLength = nLen;
GetStringData()->Validate(TRUE);
}
// ---------------------------------------------------------------------------
// data access
// ---------------------------------------------------------------------------