X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6df09f32fd0bbc2324a6a96683109e6c6cc47db5..427861bde09badef1a2950ad799e69fac6b4a48a:/interface/wx/buffer.h?ds=sidebyside diff --git a/interface/wx/buffer.h b/interface/wx/buffer.h index 3d5287b6c7..d9a61010dc 100644 --- a/interface/wx/buffer.h +++ b/interface/wx/buffer.h @@ -74,7 +74,7 @@ public: @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. @@ -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). + + @see shrink() */ 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); }; /**