git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46544
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
\membersection{wxFileSystem::FindFileInPath}\label{wxfilesystemfindfileinpath}
\membersection{wxFileSystem::FindFileInPath}\label{wxfilesystemfindfileinpath}
-\func{bool}{FindFileInPath}{\param{wxString }{*str}, \param{const wxChar }{*path}, \param{const wxChar }{*file}}
+\func{bool}{FindFileInPath}{\param{wxString }{*str}, \param{const wxString\& }{path}, \param{const wxString\& }{file}}
Looks for the file with the given name \arg{file} in a colon or semi-colon
(depending on the current platform) separated list of directories in
Looks for the file with the given name \arg{file} in a colon or semi-colon
(depending on the current platform) separated list of directories in
wxString FindNext();
// find a file in a list of directories, returns false if not found
wxString FindNext();
// find a file in a list of directories, returns false if not found
- bool FindFileInPath(wxString *pStr, const wxChar *path, const wxChar *file);
+ bool FindFileInPath(wxString *pStr,
+ const wxString& path, const wxString& file);
// Adds FS handler.
// In fact, this class is only front-end to the FS handlers :-)
// Adds FS handler.
// In fact, this class is only front-end to the FS handlers :-)
}
bool wxFileSystem::FindFileInPath(wxString *pStr,
}
bool wxFileSystem::FindFileInPath(wxString *pStr,
- const wxChar *path,
- const wxChar *basename)
+ const wxString& path,
+ const wxString& basename)
{
// we assume that it's not empty
{
// we assume that it's not empty
- wxCHECK_MSG( !wxIsEmpty(basename), false,
+ wxCHECK_MSG( !basename.empty(), false,
_T("empty file name in wxFileSystem::FindFileInPath"));
_T("empty file name in wxFileSystem::FindFileInPath"));
// skip path separator in the beginning of the file name if present
// skip path separator in the beginning of the file name if present
- if ( wxIsPathSeparator(*basename) )
- basename++;
+ if ( wxIsPathSeparator(basename[0u]) )
+ name = basename.substr(1);
+ else
+ name = basename;
wxStringTokenizer tokenizer(path, wxPATH_SEP);
while ( tokenizer.HasMoreTokens() )
wxStringTokenizer tokenizer(path, wxPATH_SEP);
while ( tokenizer.HasMoreTokens() )
wxString strFile = tokenizer.GetNextToken();
if ( !wxEndsWithPathSeparator(strFile) )
strFile += wxFILE_SEP_PATH;
wxString strFile = tokenizer.GetNextToken();
if ( !wxEndsWithPathSeparator(strFile) )
strFile += wxFILE_SEP_PATH;
wxFSFile *file = OpenFile(strFile);
if ( file )
wxFSFile *file = OpenFile(strFile);
if ( file )