From: Robert Roebling <robert@roebling.de> Date: Fri, 4 Jul 2008 07:56:32 +0000 (+0000) Subject: added wxString.t_str() and used it in filefn.cpp X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6ad68ad8c829a59953913ae034e63ed689562c82 added wxString.t_str() and used it in filefn.cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/string.h b/include/wx/string.h index ce69cb8026..91f25b154e 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -1351,7 +1351,7 @@ public: const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); } #if wxUSE_UNICODE_WCHAR - const wxChar* wc_str() const { return wx_str(); } + const wchar_t* wc_str() const { return wx_str(); } #elif wxUSE_UNICODE_UTF8 const wxWCharBuffer wc_str() const; #endif @@ -1369,7 +1369,7 @@ public: const wxChar* mb_str() const { return wx_str(); } // for compatibility with wxUSE_UNICODE version - const wxChar* mb_str(const wxMBConv& WXUNUSED(conv)) const { return wx_str(); } + const char* mb_str(const wxMBConv& WXUNUSED(conv)) const { return wx_str(); } const wxWX2MBbuf mbc_str() const { return mb_str(); } @@ -1379,6 +1379,15 @@ public: const wxCharBuffer fn_str() const { return wxConvFile.cWC2WX( wc_str( wxConvLibc ) ); } #endif // Unicode/ANSI +#if wxUSE_UNICODE_UTF8 + const wxWCharBuffer t_str() const { return wc_str(); } +#elif wxUSE_UNICODE_WCHAR + const wchar_t* t_str() const { return wx_str(); } +#else + const char* t_str() const { return wx_str(); } +#endif + + // overloaded assignment // from another wxString wxString& operator=(const wxString& stringSrc) diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index f5389f2991..b9053ba8ac 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1851,7 +1851,7 @@ static bool wxCheckWin32Permission(const wxString& path, DWORD access) HANDLE h = ::CreateFile ( - path.c_str(), + path.t_str(), access, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,