]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
don't break lines in the middle of word
[wxWidgets.git] / src / common / filename.cpp
index 639e5363c3eeca932e0ce501eeeefab5c522193e..181b06705efdf7bd43e695253d62d89025ed73c5 100644 (file)
 #include "wx/msw/winundef.h"
 #endif
 
+#ifdef __WXWINCE__
+#include "wx/msw/private.h"
+#endif
+
 #if defined(__WXMAC__)
   #include  "wx/mac/private.h"  // includes mac headers
 #endif
 #endif
 
 #ifdef __MWERKS__
+#ifdef __MACH__
+#include <sys/types.h>
+#include <utime.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#else
 #include <stat.h>
 #include <unistd.h>
 #include <unix.h>
 #endif
+#endif
 
 #ifdef __WATCOMC__
 #include <io.h>
@@ -557,8 +568,22 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
     // use the directory specified by the prefix
     SplitPath(prefix, &dir, &name, NULL /* extension */);
 
-#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
+#if defined(__WXWINCE__)
+    if (dir.empty())
+    {
+        // FIXME. Create \temp dir?
+        dir = wxT("\\");
+    }
+    path = dir + wxT("\\") + prefix;
+    int i = 1;
+    while (wxFileExists(path))
+    {
+        path = dir + wxT("\\") + prefix ;
+        path << i;
+        i ++;
+    }
 
+#elif defined(__WINDOWS__) && !defined(__WXMICROWIN__)
 #ifdef __WIN32__
     if ( dir.empty() )
     {
@@ -687,7 +712,7 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
     }
 #else // !HAVE_MKTEMP (includes __DOS__)
     // generate the unique file name ourselves
-    #ifndef __DOS__
+    #if !defined(__DOS__) && (!defined(__MWERKS__) || defined(__DARWIN__) )
     path << (unsigned int)getpid();
     #endif
 
@@ -1133,7 +1158,7 @@ void wxFileName::InsertDir( int before, const wxString &dir )
 
 void wxFileName::RemoveDir( int pos )
 {
-    m_dirs.Remove( (size_t)pos );
+    m_dirs.RemoveAt( (size_t)pos );
 }
 
 // ----------------------------------------------------------------------------
@@ -1277,7 +1302,7 @@ wxString wxFileName::GetFullPath( wxPathFormat format ) const
 // Return the short form of the path (returns identity on non-Windows platforms)
 wxString wxFileName::GetShortPath() const
 {
-#if defined(__WXMSW__) && defined(__WIN32__) && !defined(__WXMICROWIN__)
+#if defined(__WXMSW__) && defined(__WIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
     wxString path(GetFullPath());
     wxString pathOut;
     DWORD sz = ::GetShortPathName(path, NULL, 0);