]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/filename.h
Lots of cleanup, mostly consolidating globals
[wxWidgets.git] / include / wx / filename.h
index 3ad1a98fa70a6dac5a78d4a5a9a099e1fd5c5673..844c2d49165cbd5dfe901a36cf383a9211731164 100644 (file)
@@ -38,6 +38,8 @@
 #include "wx/filefn.h"
 #include "wx/datetime.h"
 
+class WXDLLEXPORT wxFile;
+
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
@@ -208,9 +210,12 @@ public:
     void AssignHomeDir();
     static wxString GetHomeDir();
 
-        // get a temp file name starting with the specified prefix
-    void AssignTempFileName(const wxString& prefix);
-    static wxString CreateTempFileName(const wxString& prefix);
+        // get a temp file name starting with the specified prefix and open the
+        // file passed to us using this name for writing (atomically if
+        // possible)
+    void AssignTempFileName(const wxString& prefix, wxFile *fileTemp = NULL);
+    static wxString CreateTempFileName(const wxString& prefix,
+                                       wxFile *fileTemp = NULL);
 
     // directory creation and removal.
     // if full is TRUE, will try to make each directory in the path.
@@ -254,8 +259,6 @@ public:
     bool operator==(const wxString& filename)
         { return *this == wxFileName(filename); }
 
-    // Tests
-
         // are the file names of this type cases sensitive?
     static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );
 
@@ -266,6 +269,12 @@ public:
         // is this filename relative?
     bool IsRelative() const
         { return m_relative; }
+        
+        // forcibly set the flag
+    void SetAbsolute()
+        { m_relative = FALSE; }
+    void SetRelative()
+        { m_relative = TRUE; }
 
     // Information about path format
 
@@ -310,6 +319,8 @@ public:
     // Construct path only - possibly with the trailing separator
     wxString GetPath( bool add_separator = FALSE,
                       wxPathFormat format = wxPATH_NATIVE ) const;
+    // Replace current path with this one
+    void SetPath( const wxString &path, wxPathFormat format = wxPATH_NATIVE );
 
     // more readable synonym
     wxString GetPathWithSep(wxPathFormat format = wxPATH_NATIVE ) const