//! and in addition under Windows @c "%var%" is also.
wxPATH_NORM_ENV_VARS = 0x0001,
- wxPATH_NORM_DOTS = 0x0002, //!< Squeeze all @c ".." and @c "." and prepend the current working directory.
+ wxPATH_NORM_DOTS = 0x0002, //!< Squeeze all @c ".." and @c ".".
wxPATH_NORM_TILDE = 0x0004, //!< Replace @c "~" and @c "~user" (Unix only).
wxPATH_NORM_CASE = 0x0008, //!< If the platform is case insensitive, make lowercase the path.
wxPATH_NORM_ABSOLUTE = 0x0010, //!< Make the path absolute.
static bool IsPathSeparator(wxChar ch,
wxPathFormat format = wxPATH_NATIVE);
+ /**
+ Returns @true if the volume part of the path is a unique volume name.
+
+ This function will always return @false if the path format is not
+ wxPATH_DOS.
+
+ Unique volume names are Windows volume identifiers which remain the same
+ regardless of where the volume is actually mounted. Example of a path
+ using a volume name could be
+ @code
+ \\?\Volume{8089d7d7-d0ac-11db-9dd0-806d6172696f}\Program Files\setup.exe
+ @endcode
+
+ @since 2.9.1
+ */
+ static bool IsMSWUniqueVolumeNamePath(const wxString& path,
+ wxPathFormat format = wxPATH_NATIVE);
+
/**
Returns @true if this filename is not absolute.
*/
@return Returns @true if the directory was successfully created, @false
otherwise.
*/
- bool Mkdir(int perm = wxS_DIR_DEFAULT, int flags = 0);
+ bool Mkdir(int perm = wxS_DIR_DEFAULT, int flags = 0) const;
/**
Creates a directory.
@return Returns @true if the directory was successfully deleted, @false
otherwise.
*/
- bool Rmdir(int flags = 0);
+ bool Rmdir(int flags = 0) const;
/**
Deletes the specified directory from the file system.
/**
Changes the current working directory.
*/
- bool SetCwd();
+ bool SetCwd() const;
/**
Changes the current working directory.
*/
void SetName(const wxString& name);
+ /**
+ Sets the full path.
+
+ The @a path argument includes both the path (and the volume, if
+ supported by @a format) and the name and extension.
+
+ @see GetPath()
+ */
+ void SetPath(const wxString& path, wxPathFormat format = wxPATH_NATIVE);
+
/**
Sets the file creation and last access/modification times (any of the pointers
may be @NULL).
*/
bool SetTimes(const wxDateTime* dtAccess,
const wxDateTime* dtMod,
- const wxDateTime* dtCreate);
+ const wxDateTime* dtCreate) const;
/**
Sets the volume specifier.
wxString* path,
wxPathFormat format = wxPATH_NATIVE);
+
+ /**
+ Strip the file extension.
+
+ This function does more than just removing everything after the last
+ period from the string, for example it will return the string ".vimrc"
+ unchanged because the part after the period is not an extension but the
+ file name in this case. You can use wxString::BeforeLast() to really
+ get just the part before the last period (but notice that that function
+ returns empty string if period is not present at all unlike this
+ function which returns the @a fullname unchanged in this case).
+
+ @param fullname
+ File path including name and, optionally, extension.
+
+ @return
+ File path without extension
+
+ @since 2.9.0
+ */
+ static wxString StripExtension(const wxString& fullname);
+
/**
Sets the access and modification times to the current moment.
*/
- bool Touch();
+ bool Touch() const;
/**
Returns @true if the filenames are different. The string @e filenames