X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce045aed585af0f00b72f1cdba893b47ac2e0e55..e80edb8515cc574f8ad264f47bd9cfe9501cfc97:/include/wx/filefn.h diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 8995c44d1c..0db4c1e6bb 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -274,16 +274,17 @@ enum wxFileKind #endif #endif - // types: notice that Watcom is the only compiler to have a wide char - // version of struct stat as well as a wide char stat function variant + // Types: Notice that Watcom is the only compiler to have a wide char + // version of struct stat as well as a wide char stat function variant. + // This was droped since OW 1.4 "for consistency across platforms". #if wxHAS_HUGE_FILES - #if wxUSE_UNICODE && defined(__WATCOMC__) + #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4) #define wxStructStat struct _wstati64 #else #define wxStructStat struct _stati64 #endif #else - #if wxUSE_UNICODE && defined(__WATCOMC__) + #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4) #define wxStructStat struct _wstat #else #define wxStructStat struct _stat @@ -435,7 +436,7 @@ WXDLLIMPEXP_BASE bool wxCopyFile(const wxString& file1, const wxString& file2, WXDLLIMPEXP_BASE bool wxRemoveFile(const wxString& file); // Rename file -WXDLLIMPEXP_BASE bool wxRenameFile(const wxString& file1, const wxString& file2); +WXDLLIMPEXP_BASE bool wxRenameFile(const wxString& file1, const wxString& file2, bool overwrite = true); // Get current working directory. #if WXWIN_COMPATIBILITY_2_6 @@ -462,15 +463,14 @@ WXDLLIMPEXP_BASE bool wxRmdir(const wxString& dir, int flags = 0); WXDLLIMPEXP_BASE wxFileKind wxGetFileKind(int fd); WXDLLIMPEXP_BASE wxFileKind wxGetFileKind(FILE *fp); +#if WXWIN_COMPATIBILITY_2_6 // compatibility defines, don't use in new code -// consider removal droping 2.4 compatibility -// #if WXWIN_COMPATIBILITY_2_4 wxDEPRECATED( inline bool wxPathExists(const wxChar *pszPathName) ); inline bool wxPathExists(const wxChar *pszPathName) { return wxDirExists(pszPathName); } -// #endif //WXWIN_COMPATIBILITY_2_4 +#endif //WXWIN_COMPATIBILITY_2_6 // ---------------------------------------------------------------------------- // separators in file names @@ -595,29 +595,35 @@ private: // Path searching -class WXDLLIMPEXP_BASE wxPathList : public wxStringList +class WXDLLIMPEXP_BASE wxPathList : public wxArrayString { public: + wxPathList() {} + wxPathList(const wxArrayString &arr) + { Add(arr); } + // avoid GCC warning about virtual functions w/o virtual dtor virtual ~wxPathList() {} // Adds all paths in environment variable void AddEnvList(const wxString& envVariable); + // Adds given path to this list void Add(const wxString& path); + void Add(const wxArrayString &paths); + // Find the first full path for which the file exists - wxString FindValidPath(const wxString& filename); + wxString FindValidPath(const wxString& filename) const; + // Find the first full path for which the file exists; ensure it's an // absolute path that gets returned. - wxString FindAbsoluteValidPath(const wxString& filename); + wxString FindAbsoluteValidPath(const wxString& filename) const; + // Given full path and filename, add path to list void EnsureFileAccessible(const wxString& path); - // Returns true if the path is in the list - bool Member(const wxString& path); -private: - // DECLARE_DYNAMIC_CLASS(wxPathList) + // Returns true if the path is in the list + wxDEPRECATED( bool Member(const wxString& path) const ); }; -#endif - // _WX_FILEFN_H_ +#endif // _WX_FILEFN_H_