X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/353f41cb3b49d4b49adaa6ee173a71bf75c17015..bc55104d9ab0b0b835644f17a152b4fbbfa8c7b9:/include/wx/filename.h?ds=inline diff --git a/include/wx/filename.h b/include/wx/filename.h index 3ad1a98fa7..ceb0fc820e 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -38,6 +38,8 @@ #include "wx/filefn.h" #include "wx/datetime.h" +class WXDLLEXPORT wxFile; + // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -194,6 +196,16 @@ public: return dtMod; } +#ifdef __WXMAC__ + bool MacSetTypeAndCreator( wxUint32 type , wxUint32 creator ) ; + bool MacGetTypeAndCreator( wxUint32 *type , wxUint32 *creator ) ; + // gets the 'common' type and creator for a certain extension + static bool MacFindDefaultTypeAndCreator( const wxString& ext , wxUint32 *type , wxUint32 *creator ) ; + // registers application defined extensions and their default type and creator + static void MacRegisterDefaultTypeAndCreator( const wxString& ext , wxUint32 type , wxUint32 creator ) ; + // looks up the appropriate type and creator from the registration and then sets + bool MacSetDefaultTypeAndCreator() ; +#endif // various file/dir operations // retrieve the value of the current working directory @@ -208,9 +220,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. @@ -227,7 +242,7 @@ public: // variables will be expanded in it // // this may be done using another (than current) value of cwd - bool Normalize(wxPathNormalize flags = wxPATH_NORM_ALL, + bool Normalize(int flags = wxPATH_NORM_ALL, const wxString& cwd = wxEmptyString, wxPathFormat format = wxPATH_NATIVE); @@ -254,8 +269,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 +279,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 +329,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