wxString and wxChar* access for file functions. Source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2004-12-21 17:35:42 +00:00
parent 7e49601492
commit f50a1c3d66
3 changed files with 10 additions and 11 deletions

View File

@ -77,7 +77,7 @@ static GLfloat yrot;
static void read_surface( const wxChar *filename ) static void read_surface( const wxChar *filename )
{ {
FILE *f = wxFopen(filename,_T("r")); FILE *f = wxFopen(wxFNCONV(filename),_T("r"));
if (!f) if (!f)
{ {
wxString msg = _T("Couldn't read "); wxString msg = _T("Couldn't read ");

View File

@ -1561,8 +1561,7 @@ bool wxPostScriptDC::StartDoc( const wxString& message )
m_printData.SetFilename(filename); m_printData.SetFilename(filename);
} }
// FIXME: use fn_str() here under Unicode? m_pstream = wxFopen( m_printData.GetFilename().fn_str(), wxT("w+") );
m_pstream = wxFopen( m_printData.GetFilename().c_str(), wxT("w+") );
if (!m_pstream) if (!m_pstream)
{ {
@ -1972,7 +1971,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
{ {
afmName = data->GetFontMetricPath(); afmName = data->GetFontMetricPath();
afmName << wxFILE_SEP_PATH << name; afmName << wxFILE_SEP_PATH << name;
afmFile = wxFopen(afmName,wxT("r")); afmFile = wxFopen(afmName.fn_str(),wxT("r"));
} }
#if defined(__UNIX__) && !defined(__VMS__) #if defined(__UNIX__) && !defined(__VMS__)
@ -1986,7 +1985,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
<< wxT("afm") << wxFILE_SEP_PATH << wxT("afm") << wxFILE_SEP_PATH
#endif #endif
<< name; << name;
afmFile = wxFopen(afmName,wxT("r")); afmFile = wxFopen(afmName.fn_str(),wxT("r"));
} }
#endif #endif

View File

@ -231,7 +231,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
wxBusyCursor b; // display a busy cursor wxBusyCursor b; // display a busy cursor
if(! ifile.IsEmpty()) if(! ifile.empty())
{ {
file = ifile; file = ifile;
if(! wxIsAbsolutePath(file)) if(! wxIsAbsolutePath(file))
@ -254,7 +254,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
// set to be "de", then look in "/usr/local/myapp/help/de/" // set to be "de", then look in "/usr/local/myapp/help/de/"
// first and fall back to "/usr/local/myapp/help" if that // first and fall back to "/usr/local/myapp/help" if that
// doesn't exist. // doesn't exist.
if(wxGetLocale() && !wxGetLocale()->GetName().IsEmpty()) if(wxGetLocale() && !wxGetLocale()->GetName().empty())
{ {
wxString newfile; wxString newfile;
newfile << WXEXTHELP_SEPARATOR << wxGetLocale()->GetName(); newfile << WXEXTHELP_SEPARATOR << wxGetLocale()->GetName();
@ -287,7 +287,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
m_MapList = new wxList; m_MapList = new wxList;
m_NumOfEntries = 0; m_NumOfEntries = 0;
FILE *input = wxFopen(mapFile,wxT("rt")); FILE *input = wxFopen(mapFile.fn_str(),wxT("rt"));
if(! input) if(! input)
return false; return false;
do do
@ -401,7 +401,7 @@ wxExtHelpController::KeywordSearch(const wxString& k,
int idx = 0, j; int idx = 0, j;
bool rc; bool rc;
bool showAll = k.IsEmpty(); bool showAll = k.empty();
wxList::compatibility_iterator node = m_MapList->GetFirst(); wxList::compatibility_iterator node = m_MapList->GetFirst();
wxExtHelpMapEntry *entry; wxExtHelpMapEntry *entry;
@ -412,12 +412,12 @@ wxExtHelpController::KeywordSearch(const wxString& k,
{ {
entry = (wxExtHelpMapEntry *)node->GetData(); entry = (wxExtHelpMapEntry *)node->GetData();
compB = entry->doc; compB.LowerCase(); compB = entry->doc; compB.LowerCase();
if((showAll || compB.Contains(k)) && ! compB.IsEmpty()) if((showAll || compB.Contains(k)) && ! compB.empty())
{ {
urls[idx] = entry->url; urls[idx] = entry->url;
// doesn't work: // doesn't work:
// choices[idx] = (**i).doc.Contains((**i).doc.Before(WXEXTHELP_COMMENTCHAR)); // choices[idx] = (**i).doc.Contains((**i).doc.Before(WXEXTHELP_COMMENTCHAR));
//if(choices[idx].IsEmpty()) // didn't contain the ';' //if(choices[idx].empty()) // didn't contain the ';'
// choices[idx] = (**i).doc; // choices[idx] = (**i).doc;
choices[idx] = wxEmptyString; choices[idx] = wxEmptyString;
for(j=0;entry->doc.c_str()[j] for(j=0;entry->doc.c_str()[j]