]> git.saurik.com Git - wxWidgets.git/commitdiff
added ctor for wxChar/WCharBuffer from wxCStrData in ANSI/Unicode build to make it...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 19 Mar 2007 13:18:02 +0000 (13:18 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 19 Mar 2007 13:18:02 +0000 (13:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44924 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/buffer.h
include/wx/string.h

index f17aa0c1abaec6c582a452f3358dd031eb1bfb32..55068fb0cb1ae2a95166935e6253f55c0adbfa7e 100644 (file)
@@ -30,6 +30,8 @@ public:                                                                     \
     {                                                                       \
     }                                                                       \
                                                                             \
+    classname(const wxCStrData& cstr);                                      \
+                                                                            \
     classname(size_t len)                                                   \
         : m_str((chartype *)malloc((len + 1)*sizeof(chartype)))             \
     {                                                                       \
index 8485ea1aad703e1b596f4655aca5b11a74c51ad3..90d3b378f29702a9cc09813edd8dd63532c23276 100644 (file)
@@ -2013,4 +2013,24 @@ inline wxUniChar wxCStrData::operator[](size_t n) const
     return m_str->at(m_offset + n);
 }
 
+// ----------------------------------------------------------------------------
+// implementation of wx[W]CharBuffer inline methods using wxCStrData
+// ----------------------------------------------------------------------------
+
+#if wxUSE_UNICODE
+
+inline wxWCharBuffer::wxWCharBuffer(const wxCStrData& cstr)
+    : m_str(wxStrdupW(cstr))
+{
+}
+
+#else // !wxUSE_UNICODE
+
+inline wxCharBuffer::wxCharBuffer(const wxCStrData& cstr)
+    : m_str(wxStrdupA(cstr))
+{
+}
+
+#endif // wxUSE_UNICODE/!wxUSE_UNICODE
+
 #endif  // _WX_WXSTRINGH__