]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/string.h
moved xti info to common file
[wxWidgets.git] / include / wx / string.h
index 32eb250aa9bbcc19864e1dc2796ea96733f3bbc6..95d440a362a8cee9299a4a5c4b3b5412ad1eb585 100644 (file)
@@ -1383,7 +1383,13 @@ public:
     #define wxStringToStdWstringRetType wxStdWideString
     wxStdWideString ToStdWstring() const
     {
+#if wxUSE_UNICODE_WCHAR
+        wxScopedWCharBuffer buf =
+            wxScopedWCharBuffer::CreateNonOwned(m_impl.c_str(), m_impl.length());
+#else // !wxUSE_UNICODE_WCHAR
         wxScopedWCharBuffer buf(wc_str());
+#endif
+
         return wxStdWideString(buf.data(), buf.length());
     }
   #endif
@@ -2210,11 +2216,13 @@ public:
       // get last nCount characters
   wxString Right(size_t nCount) const;
       // get all characters before the first occurrence of ch
-      // (returns the whole string if ch not found)
-  wxString BeforeFirst(wxUniChar ch) const;
+      // (returns the whole string if ch not found) and also put everything
+      // following the first occurrence of ch into rest if it's non-NULL
+  wxString BeforeFirst(wxUniChar ch, wxString *rest = NULL) const;
       // get all characters before the last occurrence of ch
-      // (returns empty string if ch not found)
-  wxString BeforeLast(wxUniChar ch) const;
+      // (returns empty string if ch not found) and also put everything
+      // following the last occurrence of ch into rest if it's non-NULL
+  wxString BeforeLast(wxUniChar ch, wxString *rest = NULL) const;
       // get all characters after the first occurrence of ch
       // (returns empty string if ch not found)
   wxString AfterFirst(wxUniChar ch) const;