X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b96c684f386b40a4fa13aef4665dd77db3cb919..748a3af8e74ce74fe143650af0b2da2534c70d45:/src/common/ffile.cpp diff --git a/src/common/ffile.cpp b/src/common/ffile.cpp index e1e5a2dbe1..4bca0e0e2e 100644 --- a/src/common/ffile.cpp +++ b/src/common/ffile.cpp @@ -54,7 +54,7 @@ wxFFile::wxFFile(const wxChar *filename, const char *mode) bool wxFFile::Open(const wxChar *filename, const char *mode) { - wxASSERT_MSG( !m_fp, _T("should close or detach the old file first") ); + wxASSERT_MSG( !m_fp, wxT("should close or detach the old file first") ); #if wxUSE_UNICODE char *tmp_fname; @@ -64,12 +64,20 @@ bool wxFFile::Open(const wxChar *filename, const char *mode) tmp_fname = new char[fname_len]; wxWX2MB(tmp_fname, filename, fname_len); +#ifdef __WXMAC__ + m_fp = fopen(wxUnix2MacFilename( tmp_fname ), mode); +#else m_fp = fopen(tmp_fname, mode); +#endif delete tmp_fname; +#else +#ifdef __WXMAC__ + m_fp = fopen(wxUnix2MacFilename( filename ), mode); #else m_fp = fopen(filename, mode); #endif +#endif if ( !m_fp ) @@ -107,8 +115,8 @@ bool wxFFile::Close() bool wxFFile::ReadAll(wxString *str) { - wxCHECK_MSG( str, FALSE, _T("invalid parameter") ); - wxCHECK_MSG( IsOpened(), FALSE, _T("can't read from closed file") ); + wxCHECK_MSG( str, FALSE, wxT("invalid parameter") ); + wxCHECK_MSG( IsOpened(), FALSE, wxT("can't read from closed file") ); clearerr(m_fp); @@ -137,8 +145,8 @@ bool wxFFile::ReadAll(wxString *str) size_t wxFFile::Read(void *pBuf, size_t nCount) { - wxCHECK_MSG( pBuf, FALSE, _T("invalid parameter") ); - wxCHECK_MSG( IsOpened(), FALSE, _T("can't read from closed file") ); + wxCHECK_MSG( pBuf, FALSE, wxT("invalid parameter") ); + wxCHECK_MSG( IsOpened(), FALSE, wxT("can't read from closed file") ); size_t nRead = fread(pBuf, 1, nCount, m_fp); if ( (nRead < nCount) && Error() ) @@ -151,8 +159,8 @@ size_t wxFFile::Read(void *pBuf, size_t nCount) size_t wxFFile::Write(const void *pBuf, size_t nCount) { - wxCHECK_MSG( pBuf, FALSE, _T("invalid parameter") ); - wxCHECK_MSG( IsOpened(), FALSE, _T("can't write to closed file") ); + wxCHECK_MSG( pBuf, FALSE, wxT("invalid parameter") ); + wxCHECK_MSG( IsOpened(), FALSE, wxT("can't write to closed file") ); size_t nWritten = fwrite(pBuf, 1, nCount, m_fp); if ( nWritten < nCount ) @@ -186,13 +194,13 @@ bool wxFFile::Flush() bool wxFFile::Seek(long ofs, wxSeekMode mode) { - wxCHECK_MSG( IsOpened(), FALSE, _T("can't seek on closed file") ); + wxCHECK_MSG( IsOpened(), FALSE, wxT("can't seek on closed file") ); int origin; switch ( mode ) { default: - wxFAIL_MSG(_T("unknown seek mode")); + wxFAIL_MSG(wxT("unknown seek mode")); // still fall through case wxFromStart: