changes wxDirExists() to accept wxString instead of wxChar*, so that it can be used with any string literals

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-03-02 12:44:52 +00:00
parent 1c8c91463f
commit e960c20e38
3 changed files with 5 additions and 5 deletions

View File

@@ -1280,9 +1280,9 @@ bool wxRmdir(const wxString& dir, int WXUNUSED(flags))
}
// does the path exists? (may have or not '/' or '\\' at the end)
bool wxDirExists(const wxChar *pszPathName)
bool wxDirExists(const wxString& pathName)
{
wxString strPath(pszPathName);
wxString strPath(pathName);
#if defined(__WINDOWS__) || defined(__OS2__)
// Windows fails to find directory named "c:\dir\" even if "c:\dir" exists,
@@ -1326,7 +1326,7 @@ bool wxDirExists(const wxChar *pszPathName)
return wxStat(strPath.c_str(), &st) == 0 && ((st.st_mode & S_IFMT) == S_IFDIR);
#else
// S_IFMT not supported in VA compilers.. st_mode is a 2byte value only
return wxStat(pszPathName, &st) == 0 && (st.st_mode == S_IFDIR);
return wxStat(strPath.c_str(), &st) == 0 && (st.st_mode == S_IFDIR);
#endif
#endif // __WIN32__/!__WIN32__