X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/27b2dd53f629a78266c51d1b0b5db918401dcd4f..35932e0596cb4ec38ff7a82d4fdf7ff98c4d9e97:/include/wx/filefn.h diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 1d0b0bac66..3351115ba7 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: filefn.h +// Name: wx/filefn.h // Purpose: File- and directory-related functions // Author: Julian Smart // Modified by: @@ -12,10 +12,6 @@ #ifndef _FILEFN_H_ #define _FILEFN_H_ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "filefn.h" -#endif - #include "wx/list.h" #include "wx/arrstr.h" @@ -49,6 +45,9 @@ // __OS2__ and __UNIX__ are defined. #include #include "wx/os2/private.h" + #ifdef __WATCOMC__ + #include + #endif #include #ifdef __EMX__ #include @@ -59,7 +58,7 @@ #endif #if defined(__WINDOWS__) && !defined(__WXMICROWIN__) -#if !defined( __GNUWIN32__ ) && !defined( __MWERKS__ ) && !defined(__SALFORDC__) && !defined(__WXWINCE__) +#if !defined( __GNUWIN32__ ) && !defined( __MWERKS__ ) && !defined(__SALFORDC__) && !defined(__WXWINCE__) && !defined(__CYGWIN__) #include #include #include @@ -275,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 @@ -326,7 +326,7 @@ enum wxFileKind #define wxWrite ::write #define wxLseek lseek #define wxSeek lseek - #define wxFsync commit + #define wxFsync fsync #define wxEof eof #define wxMkDir mkdir @@ -367,7 +367,7 @@ const int wxInvalidOffset = -1; WXDLLIMPEXP_BASE bool wxFileExists(const wxString& filename); // does the path exist? (may have or not '/' or '\\' at the end) -WXDLLIMPEXP_BASE bool wxPathExists(const wxChar *pszPathName); +WXDLLIMPEXP_BASE bool wxDirExists(const wxChar *pszPathName); WXDLLIMPEXP_BASE bool wxIsAbsolutePath(const wxString& filename); @@ -436,16 +436,18 @@ 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 // If buf is NULL, allocates space using new, else // copies into buf. // IMPORTANT NOTE getcwd is know not to work under some releases // of Win32s 1.3, according to MS release notes! -WXDLLIMPEXP_BASE wxChar* wxGetWorkingDirectory(wxChar *buf = (wxChar *) NULL, int sz = 1000); +wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* wxGetWorkingDirectory(wxChar *buf = (wxChar *) NULL, int sz = 1000) ); // new and preferred version of wxGetWorkingDirectory // NB: can't have the same name because of overloading ambiguity +#endif // WXWIN_COMPATIBILITY_2_6 WXDLLIMPEXP_BASE wxString wxGetCwd(); // Set working directory @@ -461,10 +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 -#if WXWIN_COMPATIBILITY_2_4 - #define wxDirExists wxPathExists -#endif +wxDEPRECATED( inline bool wxPathExists(const wxChar *pszPathName) ); +inline bool wxPathExists(const wxChar *pszPathName) +{ + return wxDirExists(pszPathName); +} +#endif //WXWIN_COMPATIBILITY_2_6 // ---------------------------------------------------------------------------- // separators in file names