+ void Assign(const wxString& volume,
+ const wxString& path,
+ const wxString& name,
+ const wxString& ext,
+ bool hasExt,
+ wxPathFormat format = wxPATH_NATIVE);
+
+ void Assign(const wxString& volume,
+ const wxString& path,
+ const wxString& name,
+ const wxString& ext,
+ wxPathFormat format = wxPATH_NATIVE)
+ { Assign(volume, path, name, ext, !ext.empty(), format); }
+
+ void Assign(const wxString& path,
+ const wxString& name,
+ wxPathFormat format = wxPATH_NATIVE);
+
+ void Assign(const wxString& path,
+ const wxString& name,
+ const wxString& ext,
+ wxPathFormat format = wxPATH_NATIVE);
+
+ void AssignDir(const wxString& dir, wxPathFormat format = wxPATH_NATIVE);
+
+ // assorted assignment operators
+
+ wxFileName& operator=(const wxFileName& filename)
+ { Assign(filename); return *this; }
+
+ wxFileName& operator=(const wxString& filename)
+ { Assign(filename); return *this; }
+
+ // reset all components to default, uninitialized state
+ void Clear();
+
+ // static pseudo constructors
+ static wxFileName FileName(const wxString& file,
+ wxPathFormat format = wxPATH_NATIVE);
+ static wxFileName DirName(const wxString& dir,
+ wxPathFormat format = wxPATH_NATIVE);
+
+ // file tests
+
+ // is the filename valid at all?
+ bool IsOk() const
+ {
+ // we're fine if we have the path or the name or if we're a root dir
+ return m_dirs.size() != 0 || !m_name.empty() || !m_relative ||
+ !m_ext.empty() || m_hasExt;
+ }
+
+ // does the file with this name exists?
+ bool FileExists() const;
+ static bool FileExists( const wxString &file );
+
+ // does the directory with this name exists?
+ bool DirExists() const;
+ static bool DirExists( const wxString &dir );
+
+ // VZ: also need: IsDirWritable(), IsFileExecutable() &c (TODO)
+
+ // time functions
+#if wxUSE_DATETIME
+ // set the file last access/mod and creation times
+ // (any of the pointers may be NULL)
+ bool SetTimes(const wxDateTime *dtAccess,
+ const wxDateTime *dtMod,
+ const wxDateTime *dtCreate);
+
+ // set the access and modification times to the current moment
+ bool Touch();
+
+ // return the last access, last modification and create times
+ // (any of the pointers may be NULL)
+ bool GetTimes(wxDateTime *dtAccess,
+ wxDateTime *dtMod,
+ wxDateTime *dtCreate) const;
+
+ // convenience wrapper: get just the last mod time of the file
+ wxDateTime GetModificationTime() const
+ {
+ wxDateTime dtMod;
+ (void)GetTimes(NULL, &dtMod, NULL);
+ return dtMod;
+ }
+#endif // wxUSE_DATETIME
+
+#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