X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..232b2162776e08c0b16d5280b90f5c075f38c667:/interface/wx/buffer.h diff --git a/interface/wx/buffer.h b/interface/wx/buffer.h index 830330adfc..504df2aeb6 100644 --- a/interface/wx/buffer.h +++ b/interface/wx/buffer.h @@ -6,6 +6,78 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// + +/** + wxCharTypeBuffer is a template class for storing characters. + + @todo provide better docs for this class + + @nolibrary + @category{misc} +*/ +template +class wxCharTypeBuffer +{ +public: + typedef T CharType; + + wxCharTypeBuffer(const CharType *str = NULL); + wxCharTypeBuffer(size_t len); + wxCharTypeBuffer(const wxCharTypeBuffer& src); + ~wxCharTypeBuffer(); + + void reset(); + + wxCharTypeBuffer& operator=(const CharType *str); + wxCharTypeBuffer& operator=(const wxCharTypeBuffer& src); + + bool extend(size_t len); + + CharType *data(); + const CharType *data() const; + operator const CharType *() const; + CharType operator[](size_t n) const; +}; + +/** + This is a specialization of wxCharTypeBuffer for @c char type. + + @todo provide better docs for this class + + @nolibrary + @category{misc} +*/ +class wxCharBuffer : public wxCharTypeBuffer +{ +public: + typedef wxCharTypeBuffer wxCharTypeBufferBase; + + wxCharBuffer(const wxCharTypeBufferBase& buf); + wxCharBuffer(const CharType *str = NULL); + wxCharBuffer(size_t len); + wxCharBuffer(const wxCStrData& cstr); +}; + +/** + This is a specialization of wxCharTypeBuffer for @c wchar_t type. + This class is available only when wxUSE_WCHAR_T==1 + + @nolibrary + @category{misc} +*/ +class wxWCharBuffer : public wxCharTypeBuffer +{ +public: + typedef wxCharTypeBuffer wxCharTypeBufferBase; + + wxWCharBuffer(const wxCharTypeBufferBase& buf); + wxWCharBuffer(const CharType *str = NULL); + wxWCharBuffer(size_t len); + wxWCharBuffer(const wxCStrData& cstr); +}; + + + /** @class wxMemoryBuffer @@ -34,7 +106,7 @@ public: @param size size of the new buffer. */ - wxMemoryBuffer(size_t size); + wxMemoryBuffer(size_t size = DefBufSize); /** Append a single byte to the buffer.