// ridiculously enough, this will replace DirExists with wxDirExists etc
#include "wx/filefn.h"
+#include "wx/datetime.h"
// ----------------------------------------------------------------------------
// constants
wxPATH_NORM_TILDE = 0x0004, // Unix only: replace ~ and ~user
wxPATH_NORM_CASE = 0x0008, // if case insensitive => tolower
wxPATH_NORM_ABSOLUTE = 0x0010, // make the path absolute
- wxPATH_NORM_ALL = 0x001f
+ wxPATH_NORM_LONG = 0x0020, // make the path the long form
+ wxPATH_NORM_ALL = 0x003f
};
// ----------------------------------------------------------------------------
wxPathFormat format = wxPATH_NATIVE)
{ Assign(path, name, ext, format); }
- // assorted assignment operators
-
- wxFileName& operator=(const wxFileName& filename)
- { Assign(filename); return *this; }
-
- wxFileName& operator=(const wxString& filename)
- { Assign(filename); return *this; }
-
// the same for delayed initialization
// VZ: wouldn't it be better to call this Create() for consistency with
void AssignDir(const wxString& dir, wxPathFormat format = wxPATH_NATIVE)
{ Assign(dir, _T(""), format); }
+ // 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();
bool DirExists();
static bool DirExists( const wxString &dir );
+ // Well, get modification time with sec resolution
+ wxDateTime GetModificationTime();
+
// VZ: also need: IsDirWritable(), IsFileExecutable() &c (TODO)
// various file/dir operations
// get a temp file name starting with thespecified prefix
void AssignTempFileName( const wxString &prefix );
- // directory creation and removal
- bool Mkdir( int perm = 0777 );
- static bool Mkdir( const wxString &dir, int perm = 0777 );
+ // directory creation and removal.
+ // if full is TRUE, will try to make each directory in the path.
+ bool Mkdir( int perm = 0777, bool full = FALSE);
+ static bool Mkdir( const wxString &dir, int perm = 0777, bool full = FALSE );
bool Rmdir();
static bool Rmdir( const wxString &dir );
// Comparison
+ // compares with the rules of this platform
+ bool SameAs(const wxFileName &filepath,
+ wxPathFormat format = wxPATH_NATIVE);
+
// uses the current platform settings
bool operator==(const wxFileName& filename) { return SameAs(filename); }
bool operator==(const wxString& filename)
{ return *this == wxFileName(filename); }
- // compares with the rules of this platform
- bool SameAs(const wxFileName &filepath,
- wxPathFormat format = wxPATH_NATIVE);
-
// Tests
static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );
bool IsRelative( wxPathFormat format = wxPATH_NATIVE );
// Construct full path with name and ext
wxString GetFullPath( wxPathFormat format = wxPATH_NATIVE ) const;
+ // Return the short form of the path (returns identity on non-Windows platforms)
+ wxString GetShortPath() const;
+
+ // Return the long form of the path (returns identity on non-Windows platforms)
+ wxString GetLongPath() const;
+
// various helpers
// get the canonical path format for this platform