]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/buffer.h
Fix scrolling to the bottom in wxTextCtrl::AppendText().
[wxWidgets.git] / interface / wx / buffer.h
index 3d5287b6c7270730e13ade1ffe04a03162ec5ca3..d9a61010dcc7e62b7dc7ecdadc2b4c0df5c250f5 100644 (file)
@@ -74,7 +74,7 @@ public:
         @param len If specified, length of the string, otherwise the string
                    is considered to be NUL-terminated.
      */
         @param len If specified, length of the string, otherwise the string
                    is considered to be NUL-terminated.
      */
-    static const wxScopedCharTypeBuffer CreateOwned(const CharType *str, size_t len = wxNO_LEN);
+    static const wxScopedCharTypeBuffer CreateOwned(CharType *str, size_t len = wxNO_LEN);
 
     /**
         Copy constructor.
 
     /**
         Copy constructor.
@@ -200,8 +200,27 @@ public:
 
         Can only be called on buffers that don't share data with another
         buffer (i.e. reference count of the data is 1).
 
         Can only be called on buffers that don't share data with another
         buffer (i.e. reference count of the data is 1).
+
+        @see shrink()
      */
     bool extend(size_t len);
      */
     bool extend(size_t len);
+
+    /**
+        Shrinks the buffer to have size @a len and NUL-terminates the string
+        at this length.
+
+        Can only be called on buffers that don't share data with another
+        buffer (i.e. reference count of the data is 1).
+
+        @param len Length to shrink to. Must not be larger than current length.
+
+        @note The string is not reallocated to take less memory.
+
+        @since 2.9.0
+
+        @see extend()
+     */
+    bool shrink(size_t len);
 };
 
 /**
 };
 
 /**