]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/string.h
fixed bug with the caret positioning after SetValue() introduced by the last commit
[wxWidgets.git] / include / wx / string.h
index 31a9a2b30c5e074fbb9079c0515af735be717151..6c035428b1b0ba41624afd801551adfd07e18829 100644 (file)
@@ -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
 // ---------------------------------------------------------------------------