]> git.saurik.com Git - wxWidgets.git/commitdiff
Minor additions to make working with binary buffers easier.
authorRobin Dunn <robin@alldunn.com>
Mon, 31 Jan 2000 21:22:44 +0000 (21:22 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 31 Jan 2000 21:22:44 +0000 (21:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/string.h
src/common/string.cpp

index bbe4d0cce7d2a5f42890237268c5c4c46310c2ee..1b0c138ea923d5d4a9958c548a04d6486f2357fc 100644 (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
 
index fd6ee0a7800b51fd2a2db3283c402c8b2480705f..559bf3311f664b16777add6d36bf1c66faad9f86 100644 (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
 // ---------------------------------------------------------------------------