X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3826db3ef5fc3ac97fb91aa11eb2381b2c96248d..d1427b705318677afe28b1291867f6930c8823a7:/src/common/filefn.cpp diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index b0fff2802d..90b49c111d 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -26,6 +26,7 @@ #endif #include "wx/utils.h" +#include #include #include @@ -267,6 +268,21 @@ void wxStripExtension(char *buffer) } } +void wxStripExtension(wxString& buffer) +{ + size_t len = buffer.Length(); + size_t i = len-1; + while (i > 0) + { + if (buffer.GetChar(i) == '.') + { + buffer = buffer.Left(i); + break; + } + i --; + } +} + // Destructive removal of /./ and /../ stuff char *wxRealPath (char *path) { @@ -721,7 +737,11 @@ wxDos2UnixFilename (char *s) } void +#ifdef __WXMSW__ wxUnix2DosFilename (char *s) +#else +wxUnix2DosFilename (char *WXUNUSED(s)) +#endif { // Yes, I really mean this to happen under DOS only! JACS #ifdef __WXMSW__ @@ -941,7 +961,7 @@ char *wxGetTempFileName(const wxString& prefix, char *buf) return buf; } } - cerr << "wxWindows: error finding temporary file name.\n"; + cerr << _("wxWindows: error finding temporary file name.\n"); if (buf) buf[0] = 0; return NULL; #endif @@ -1285,7 +1305,7 @@ bool wxFindFileInPath(wxString *pStr, const char *pszPath, const char *pszFile) { // we assume that it's not empty wxCHECK_MSG( !IsEmpty(pszFile), FALSE, - "empty file name in wxFindFileInPath"); + _("empty file name in wxFindFileInPath")); // skip path separator in the beginning of the file name if present if ( wxIsPathSeparator(*pszFile) ) @@ -1320,7 +1340,7 @@ void WXDLLEXPORT wxSplitPath(const char *pszFileName, wxString *pstrName, wxString *pstrExt) { - wxCHECK_RET( pszFileName, "NULL file name in wxSplitPath" ); + wxCHECK_RET( pszFileName, _("NULL file name in wxSplitPath") ); const char *pDot = strrchr(pszFileName, FILE_SEP_EXT); const char *pSepUnix = strrchr(pszFileName, FILE_SEP_PATH_UNIX); @@ -1331,7 +1351,7 @@ void WXDLLEXPORT wxSplitPath(const char *pszFileName, uint nPosDos = pSepDos ? pSepDos - pszFileName : 0; if ( nPosDos > nPosUnix ) nPosUnix = nPosDos; - uint nLen = Strlen(pszFileName); +// uint nLen = Strlen(pszFileName); if ( pstrPath ) *pstrPath = wxString(pszFileName, nPosUnix);