+ /// Default constructor, creates NULL buffer.
+ wxScopedCharTypeBuffer();
+
+ /**
+ Creates non-owned buffer from string data @a str.
+
+ The buffer's destructor will not destroy @a str. The returned buffer's
+ data is valid only as long as @a str is valid.
+
+ @param str String data.
+ @param len If specified, length of the string, otherwise the string
+ is considered to be NUL-terminated.
+ */
+ static const wxScopedCharTypeBuffer CreateNonOwned(const CharType *str, size_t len = wxNO_LEN);
+
+ /**
+ Creates owned buffer from @a str and takes ownership of it.
+
+ The buffer's destructor will free @a str when its reference count
+ reaches zero (initial count is 1).
+
+ @param str String data.
+ @param len If specified, length of the string, otherwise the string
+ is considered to be NUL-terminated.
+ */
+ static const wxScopedCharTypeBuffer CreateOwned(CharType *str, size_t len = wxNO_LEN);
+
+ /**
+ Copy constructor.
+
+ Increases reference count on the data, does @em not make wxStrdup()
+ copy of the data.
+ */
+ wxScopedCharTypeBuffer(const wxScopedCharTypeBuffer& src);
+
+ /// Assignment operator behaves in the same way as the copy constructor.
+ wxScopedCharTypeBuffer& operator=(const wxScopedCharTypeBuffer& src);
+
+ /**
+ Destructor. Frees stored data if it is in "owned" mode and data's
+ reference count reaches zero.
+ */
+ ~wxScopedCharTypeBuffer();
+
+ /// Resets the buffer to NULL, freeing the data if necessary.
+ void reset();
+
+ /// Returns pointer to the stored data.
+ CharType *data();
+
+ /// Returns const pointer to the stored data.
+ const CharType *data() const;
+
+ /// Returns length of the string stored.
+ size_t length() const;
+
+ /// Implicit conversion to C string.
+ operator const CharType *() const;
+
+ /// Random access to the stored C string.
+ CharType operator[](size_t n) const;
+};
+
+/// Scoped char buffer.
+typedef wxScopedCharTypeBuffer<char> wxScopedCharBuffer;
+
+/// Scoped wchar_t buffer.
+typedef wxScopedCharTypeBuffer<wchar_t> wxScopedWCharBuffer;
+
+/**
+ wxCharTypeBuffer<T> is a template class for storing characters.
+
+ The difference from wxScopedCharTypeBuffer<T> is that this class
+ doesn't have non-owned mode and the data stored in it are valid for
+ as long as the buffer instance exists. Other than that, this class'
+ behaviour is the same as wxScopedCharTypeBuffer<T>'s -- in particular,
+ the data are reference-counted and copying the buffer is cheap.
+
+ wxScopedCharTypeBuffer<T> buffers can be converted into wxCharTypeBuffer<T>.
+
+ @tparam T
+ The type of the characters stored in this class.
+
+ @since 2.9.0
+
+ @nolibrary
+ @category{data}
+*/
+template <typename T>
+class wxCharTypeBuffer : public wxScopedCharTypeBuffer<T>
+{
+public:
+ /**
+ Creates (owned) buffer from @a str and takes ownership of it.
+
+ @param str String data.
+ @param len If specified, length of the string, otherwise the string
+ is considered to be NUL-terminated.
+
+ @see wxScopedCharTypeBuffer<T>::CreateOwned()
+ */
+ wxCharTypeBuffer(const CharType *str = NULL, size_t len = wxNO_LEN);
+
+
+ /**
+ Creates (owned) buffer of size @a len.
+
+ @see wxScopedCharTypeBuffer<T>::CreateOwned()
+ */