X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/834c8ade287891232820e8111379cfa1c58f8828..7499628f59651e5ea4c01303ec631193dbe7ed96:/src/common/filefn.cpp diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 24324f04ee..322f7c16c6 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -104,8 +104,9 @@ // private globals // ---------------------------------------------------------------------------- -// MT-FIXME: get rid of this horror and all code using it +#if WXWIN_COMPATIBILITY_2_8 static wxChar wxFileFunctionsBuffer[4*_MAXPATHLEN]; +#endif #if defined(__VISAGECPP__) && __IBMCPP__ >= 400 // @@ -293,9 +294,10 @@ wxString wxPathList::FindAbsoluteValidPath (const wxString& file) const } // ---------------------------------------------------------------------------- -// miscellaneous global functions (TOFIX!) +// miscellaneous global functions // ---------------------------------------------------------------------------- +#if WXWIN_COMPATIBILITY_2_8 static inline wxChar* MYcopystring(const wxString& s) { wxChar* copy = new wxChar[s.length() + 1]; @@ -308,6 +310,7 @@ static inline CharType* MYcopystring(const CharType* s) CharType* copy = new CharType[wxStrlen(s) + 1]; return wxStrcpy(copy, s); } +#endif bool @@ -360,6 +363,7 @@ wxIsAbsolutePath (const wxString& filename) return false ; } +#if WXWIN_COMPATIBILITY_2_8 /* * Strip off any extension (dot something) from end of file, * IF one exists. Inserts zero into buffer. @@ -478,7 +482,7 @@ wxString wxRealPath(const wxString& path) wxChar *wxCopyAbsolutePath(const wxString& filename) { if (filename.empty()) - return (wxChar *) NULL; + return NULL; if (! wxIsAbsolutePath(wxExpandPath(wxFileFunctionsBuffer, filename))) { @@ -711,7 +715,7 @@ wxContractPath (const wxString& filename, static wxChar dest[_MAXPATHLEN]; if (filename.empty()) - return (wxChar *) NULL; + return NULL; wxStrcpy (dest, filename); #ifdef __WXMSW__ @@ -755,6 +759,8 @@ wxContractPath (const wxString& filename, return dest; } +#endif // #if WXWIN_COMPATIBILITY_2_8 + // Return just the filename, not the path (basename) wxChar *wxFileNameFromPath (wxChar *path) { @@ -822,7 +828,7 @@ wxPathOnly (wxChar *path) } #endif } - return (wxChar *) NULL; + return NULL; } // Return just the directory, or NULL if no directory @@ -949,13 +955,16 @@ void wxMacFilename2FSSpec( const wxString& path , FSSpec *spec ) OSStatus err = noErr; FSRef fsRef; wxMacPathToFSRef( path , &fsRef ); - err = FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, NULL, spec, NULL); + err = FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, NULL, spec, NULL); verify_noerr( err ); } #endif #endif // __WXMAC__ + +#if WXWIN_COMPATIBILITY_2_8 + template static void wxDoDos2UnixFilename(T *s) { @@ -998,6 +1007,8 @@ wxDoUnix2DosFilename(T *WXUNUSED(s) ) void wxUnix2DosFilename(char *s) { wxDoUnix2DosFilename(s); } void wxUnix2DosFilename(wchar_t *s) { wxDoUnix2DosFilename(s); } +#endif // #if WXWIN_COMPATIBILITY_2_8 + // Concatenate two files to form third bool wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& file3) @@ -1365,6 +1376,8 @@ bool wxDirExists(const wxString& pathName) #endif // __WIN32__/!__WIN32__ } +#if WXWIN_COMPATIBILITY_2_8 + // Get a temporary filename, opening and closing the file. wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf) { @@ -1399,6 +1412,8 @@ bool wxGetTempFileName(const wxString& prefix, wxString& buf) #endif // wxUSE_FILE/!wxUSE_FILE } +#endif // #if WXWIN_COMPATIBILITY_2_8 + // Get first file name matching given wild card. static wxDir *gs_dir = NULL; @@ -1406,7 +1421,7 @@ static wxString gs_dirPath; wxString wxFindFirstFile(const wxString& spec, int flags) { - wxSplitPath(spec, &gs_dirPath, NULL, NULL); + wxFileName::SplitPath(spec, &gs_dirPath, NULL, NULL); if ( gs_dirPath.empty() ) gs_dirPath = wxT("."); if ( !wxEndsWithPathSeparator(gs_dirPath ) ) @@ -1520,7 +1535,7 @@ wxChar *wxDoGetCwd(wxChar *buf, int sz) { sz -= 3; rc = ::DosQueryCurrentDir( 0 // current drive - ,cbuf + 3 + ,(PBYTE)cbuf + 3 ,(PULONG)&sz ); cbuf[0] = char('A' + (ulDriveNum - 1)); @@ -1705,6 +1720,7 @@ bool wxFindFileInPath(wxString *pStr, const wxString& szPath, const wxString& sz return false; } +#if WXWIN_COMPATIBILITY_2_8 void WXDLLIMPEXP_BASE wxSplitPath(const wxString& fileName, wxString *pstrPath, wxString *pstrName, @@ -1712,6 +1728,7 @@ void WXDLLIMPEXP_BASE wxSplitPath(const wxString& fileName, { wxFileName::SplitPath(fileName, pstrPath, pstrName, pstrExt); } +#endif // #if WXWIN_COMPATIBILITY_2_8 #if wxUSE_DATETIME