X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/53dfbfa5c994400f8dfddc8ef3ee3d1e7e0146fe..fd5907ffd9b0785bb6eb6f2546101623b23827c5:/include/wx/string.h diff --git a/include/wx/string.h b/include/wx/string.h index 32eb250aa9..f51d3f0660 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -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 @@ -2115,7 +2121,7 @@ public: // insert an unsigned long into string wxString& operator<<(unsigned long ul) { return (*this) << Format(wxT("%lu"), ul); } -#if defined wxLongLong_t && !defined wxLongLongIsLong +#ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG // insert a long long if they exist and aren't longs wxString& operator<<(wxLongLong_t ll) { @@ -2126,7 +2132,7 @@ public: { return (*this) << Format("%" wxLongLongFmtSpec "u" , ull); } -#endif // wxLongLong_t && !wxLongLongIsLong +#endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG // insert a float into string wxString& operator<<(float f) { return (*this) << Format(wxT("%f"), f); } @@ -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;