From: Włodzimierz Skiba Date: Tue, 21 Dec 2004 18:57:20 +0000 (+0000) Subject: wxString and wxChar* access for file functions. Source cleaning. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4430ec36d1707fa18b28590bceb5d5d7cacbc337 wxString and wxChar* access for file functions. Source cleaning. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/contrib/src/deprecated/resource.cpp b/contrib/src/deprecated/resource.cpp index 4c7f8a67c3..0475a8d825 100644 --- a/contrib/src/deprecated/resource.cpp +++ b/contrib/src/deprecated/resource.cpp @@ -251,7 +251,7 @@ bool wxResourceTable::ParseResourceFile(const wxString& filename) { wxExprDatabase db; - FILE *fd = wxFopen(filename, wxT("r")); + FILE *fd = wxFopen(filename.fn_str(), wxT("r")); if (!fd) return false; bool eof = false; @@ -2831,7 +2831,7 @@ bool wxResourceParseIncludeFile(const wxString& f, wxResourceTable *table) if (!table) table = wxDefaultResourceTable; - FILE *fd = wxFopen(f, wxT("r")); + FILE *fd = wxFopen(f.fn_str(), wxT("r")); if (!fd) { return false; diff --git a/contrib/src/deprecated/wxexpr.cpp b/contrib/src/deprecated/wxexpr.cpp index 457a60aab6..3f30116607 100644 --- a/contrib/src/deprecated/wxexpr.cpp +++ b/contrib/src/deprecated/wxexpr.cpp @@ -1072,7 +1072,7 @@ bool wxExprDatabase::Read(const wxString& filename) { noErrors = 0; - FILE *f = wxFopen(filename, _T("r")); + FILE *f = wxFopen(filename.fn_str(), _T("r")); if (f) { thewxExprDatabase = this; @@ -1104,7 +1104,7 @@ bool wxExprDatabase::ReadFromString(const wxString& buffer) bool wxExprDatabase::Write(const wxString& fileName) { - FILE *stream = wxFopen( fileName, _T("w+")); + FILE *stream = wxFopen( fileName.fn_str(), _T("w+")); if (!stream) return false; diff --git a/contrib/src/ogl/mfutils.cpp b/contrib/src/ogl/mfutils.cpp index 229895912b..046a2164fd 100644 --- a/contrib/src/ogl/mfutils.cpp +++ b/contrib/src/ogl/mfutils.cpp @@ -158,7 +158,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) { HandleTableSize = 0; - FILE *handle = wxFopen(file, wxT("rb")); + FILE *handle = wxFopen(wxFNCONV(file), wxT("rb")); if (!handle) return false; // Read placeable metafile header, if any diff --git a/contrib/utils/convertrc/rc2wxr.cpp b/contrib/utils/convertrc/rc2wxr.cpp index d31c59a49e..6ae35ab719 100644 --- a/contrib/utils/convertrc/rc2wxr.cpp +++ b/contrib/utils/convertrc/rc2wxr.cpp @@ -96,77 +96,36 @@ rc2wxr::~rc2wxr() void rc2wxr::Convert(wxString wxrfile, wxString rcfile) - { + m_rc.Open(rcfile); + m_filesize=m_rc.Length(); + if( (m_wxr = wxFopen( wxrfile.fn_str(), _T("wt") )) == NULL ) + { + return; + } -m_rc.Open(rcfile); - -m_filesize=m_rc.Length(); - -if( (m_wxr = wxFopen( wxrfile, _T("wt") )) == NULL ) - -{ - - return; - -} - - - - - -wxString tok,prevtok; - - - - - -while (!m_done) - -{ - - - -tok=GetToken(); - - - -if (tok==_T("DIALOG")) - -{ - -ParseDialog(prevtok); - -} - - - - - -if (tok==_T("MENU")) - -{ - -ParseMenu(prevtok); - -} - - - -prevtok=tok; - -} - - + wxString tok,prevtok; -fclose(m_wxr); + while (!m_done) + { + tok=GetToken(); -//fclose(m_rc); + if (tok==_T("DIALOG")) + { + ParseDialog(prevtok); + } -m_rc.Close(); + if (tok==_T("MENU")) + { + ParseMenu(prevtok); + } + prevtok=tok; + } + fclose(m_wxr); + m_rc.Close(); }