#endif
#include "wx/utils.h"
+#include <wx/intl.h>
#include <ctype.h>
#include <stdio.h>
#include <dirent.h>
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#ifndef __GNUWIN32__
#include <direct.h>
#include <dos.h>
#include <dir.h>
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#include "windows.h"
#endif
void wxPathList::AddEnvList (const wxString& envVariable)
{
static const char PATH_TOKS[] =
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
" ;"; // Don't seperate with colon in DOS (used for drive)
#else
" :;";
{
wxString path2((char *) node->Data ());
if (
-#if defined(__WXMSW__) || defined(__VMS__)
+#if defined(__WINDOWS__) || defined(__VMS__)
// Case INDEPENDENT
path.CompareTo (path2, wxString::ignoreCase) == 0
#else
if (ch != '\\' && ch != '/')
strcat (wxBuffer, "/");
strcat (wxBuffer, filename);
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
Unix2DosFilename (wxBuffer);
#endif
if (wxFileExists (wxBuffer))
lastCh = buf[len-1];
if (lastCh != '/' && lastCh != '\\')
{
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
strcat(buf, "\\");
#else
strcat(buf, "/");
#ifdef __VMS__
|| (filename[0] == '[' && filename[1] != '.')
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
/* MSDOS */
|| filename[0] == '\\' || (isalpha (filename[0]) && filename[1] == ':')
#endif
}
}
+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)
{
}
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__
bool wxMkdir(const wxString& dir)
{
-#ifdef __VMS__
+#if defined(__WXSTUBS__)
+ return FALSE;
+#elif defined(__VMS__)
return FALSE;
#elif (defined(__GNUWIN32__) && !defined(__MINGW32__)) || !defined(__WXMSW__)
return (mkdir (WXSTRINGCAST dir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0);
// Get a temporary filename, opening and closing the file.
char *wxGetTempFileName(const wxString& prefix, char *buf)
{
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#ifndef __WIN32__
char tmp[144];
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
{
#ifdef __UNIX__
return (chdir(d) == 0);
-#elif defined(__WXMSW__)
+#elif defined(__WINDOWS__)
#ifdef __WIN32__
return (bool)(SetCurrentDirectory(d) != 0);
{
// 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) )
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);
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);