]> 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 24a6585e4d790d54c606645b96e40a319ab95199..6c035428b1b0ba41624afd801551adfd07e18829 100644 (file)
@@ -63,7 +63,7 @@
 
 #ifdef HAVE_STRINGS_H
     #include <strings.h>    // for strcasecmp()
-#endif // AIX
+#endif // HAVE_STRINGS_H
 
 #include "wx/defs.h"        // everybody should include this
 #include "wx/wxchar.h"      // for wxChar
@@ -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
 // ---------------------------------------------------------------------------