]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/buffer.h
More resource files
[wxWidgets.git] / include / wx / buffer.h
index d64ed386e61666750e5f1841ccae6d09bb519930..e4a43eccae38c544b833fc9f7d4d24c53af39fb4 100644 (file)
@@ -30,7 +30,7 @@ public:
     {
         wxASSERT_MSG( str, wxT("NULL string in wxCharBuffer") );
 
-        m_str = str ? strdup(str) : (char *)NULL;
+        m_str = str ? wxStrdup(str) : (char *)NULL;
     }
     wxCharBuffer(size_t len)
     {
@@ -54,6 +54,7 @@ public:
      return *this;
    }
 
+   const char *data() const { return m_str; }
    operator const char *() const { return m_str; }
    char operator[](size_t n) const { return m_str[n]; }
 
@@ -70,7 +71,8 @@ public:
         wxASSERT_MSG( wcs, wxT("NULL string in wxWCharBuffer") );
 
         if (wcs) {
-#if (defined(__BORLANDC__) && (__BORLANDC__ > 0x530))
+#if ( defined(__BORLANDC__) && (__BORLANDC__ > 0x530) ) \
+    || ( defined(__MWERKS__) && defined(__WXMSW__) )
           size_t siz = (std::wcslen(wcs)+1)*sizeof(wchar_t);
 #else
           size_t siz = (::wcslen(wcs)+1)*sizeof(wchar_t);
@@ -103,6 +105,7 @@ public:
      return *this;
    }
 
+   const wchar_t *data() const { return m_wcs; }
    operator const wchar_t *() const { return m_wcs; }
    wchar_t operator[](size_t n) const { return m_wcs[n]; }