]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/buffer.h
extract setting max length in wxGridCellTextEditor::DoCreate() and call it from wxGri...
[wxWidgets.git] / include / wx / buffer.h
index c3d246e7fc46b18e5edc70260f2083c08dc859d0..6d50b2a0a9035ac69bb4d9e46727b04a1653580d 100644 (file)
 #ifndef _WX_BUFFER_H
 #define _WX_BUFFER_H
 
-#include "wx/wxchar.h"
+#include "wx/chartype.h"
+#include "wx/wxcrt.h"
 
 #include <stdlib.h>             // malloc() and free()
 
+class WXDLLIMPEXP_BASE wxCStrData;
+
 inline char *wxStrDup(const char *s) { return wxStrdupA(s); }
 #if wxUSE_WCHAR_T
     inline wchar_t *wxStrDup(const wchar_t *ws) { return wxStrdupW(ws); }
@@ -45,10 +48,10 @@ public:
         m_str[len] = (CharType)0;
     }
 
-    static wxCharTypeBuffer CreateNonOwned(const CharType *str)
+    static const wxCharTypeBuffer CreateNonOwned(const CharType *str)
     {
         wxCharTypeBuffer buf;
-        buf.m_str = str;
+        buf.m_str = wx_const_cast(CharType*, str);
         buf.m_owned = false;
         return buf;
     }
@@ -157,6 +160,9 @@ class WXDLLIMPEXP_BASE wxCharBuffer : public wxCharTypeBuffer<char>
 public:
     typedef wxCharTypeBuffer<char> wxCharTypeBufferBase;
 
+    wxCharBuffer(const wxCharTypeBufferBase& buf)
+        : wxCharTypeBufferBase(buf) {}
+
     wxCharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {}
     wxCharBuffer(size_t len) : wxCharTypeBufferBase(len) {}
 
@@ -169,6 +175,9 @@ class WXDLLIMPEXP_BASE wxWCharBuffer : public wxCharTypeBuffer<wchar_t>
 public:
     typedef wxCharTypeBuffer<wchar_t> wxCharTypeBufferBase;
 
+    wxWCharBuffer(const wxCharTypeBufferBase& buf)
+        : wxCharTypeBufferBase(buf) {}
+
     wxWCharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {}
     wxWCharBuffer(size_t len) : wxCharTypeBufferBase(len) {}