X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bedaf53eaf4e2a860b34d4ff5e0b1928ce8fa5c9..30a72e62977e4c532ae2f265db72535a5cccbbab:/src/common/filefn.cpp diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 8108e29a51..92a7946418 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -78,6 +78,7 @@ #endif // native Win compiler #ifdef __GNUWIN32__ + #include #ifndef __TWIN32__ #include #endif @@ -285,6 +286,14 @@ wxFileExists (const wxString& filename) bool wxIsAbsolutePath (const wxString& filename) { +#ifdef __WXMAC__ + if (filename != wxT("")) + { + if( filename.Find(':') != wxNOT_FOUND && filename[0] != ':' ) + return TRUE ; + } + return FALSE ; +#else if (filename != wxT("")) { if (filename[0] == wxT('/') @@ -299,6 +308,7 @@ wxIsAbsolutePath (const wxString& filename) return TRUE; } return FALSE; +#endif } /* @@ -836,7 +846,6 @@ void wxMacFilename2FSSpec( const char *path , FSSpec *spec ) FSpLocationFromFullPath( strlen(path ) , path , spec ) ; } -/* static char sMacFileNameConversion[ 1000 ] ; wxString wxMac2UnixFilename (const char *str) @@ -908,17 +917,12 @@ wxString wxMacFSSpec2UnixFilename( const FSSpec *spec ) return wxMac2UnixFilename( wxMacFSSpec2MacFilename( spec) ) ; } -void wxMacFilename2FSSpec( const char *path , FSSpec *spec ) -{ - FSpLocationFromFullPath( strlen(path ) , path , spec ) ; -} - void wxUnixFilename2FSSpec( const char *path , FSSpec *spec ) { wxString var = wxUnix2MacFilename( path ) ; wxMacFilename2FSSpec( var , spec ) ; } -*/ + #endif void wxDos2UnixFilename (char *s) @@ -998,7 +1002,7 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil bool wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite) { -#if defined(__WIN32__) +#if defined(__WIN32__) && !defined(__WXMICROWIN__) // CopyFile() copies file attributes and modification time too, so use it // instead of our code if available // @@ -1104,7 +1108,10 @@ wxRenameFile (const wxString& file1, const wxString& file2) bool wxRemoveFile(const wxString& file) { -#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__) +#if defined(__VISUALC__) \ + || defined(__BORLANDC__) \ + || defined(__WATCOMC__) \ + || defined(__GNUWIN32__) int res = wxRemove(file); #else int res = unlink(OS_FILENAME(file)); @@ -1122,7 +1129,7 @@ bool wxMkdir(const wxString& dir, int perm) // assume mkdir() has 2 args on non Windows-OS/2 platforms and on Windows too // for the GNU compiler -#if (!(defined(__WXMSW__) || defined(__WXPM__))) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) || defined(__WXWINE__) +#if (!(defined(__WXMSW__) || defined(__WXPM__))) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) || defined(__WXWINE__) || defined(__WXMICROWIN__) if ( mkdir(wxFNCONV(dirname), perm) != 0 ) #elif defined(__WXPM__) if (::DosCreateDir((PSZ)dirname, NULL) != 0) // enhance for EAB's?? @@ -1190,7 +1197,7 @@ bool wxPathExists(const wxChar *pszPathName) // Get a temporary filename, opening and closing the file. wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf) { -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) #ifndef __WIN32__ wxChar tmp[144]; @@ -1809,7 +1816,7 @@ bool wxSetWorkingDirectory(const wxString& d) // On non-Windows platform, probably just return the empty string. wxString wxGetOSDirectory() { -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) wxChar buf[256]; GetWindowsDirectory(buf, 256); return wxString(buf);