X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dfecbee5795f4ecd50ece7dda7c1ff49f181a04d..d11e8786ed13b72766eea18cb577cc00f9f08f41:/include/wx/filename.h diff --git a/include/wx/filename.h b/include/wx/filename.h index 131b6fc51e..ad9feee7af 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -35,7 +35,6 @@ 3. SameFileAs() function to compare inodes under Unix */ -// ridiculously enough, this will replace DirExists with wxDirExists etc #include "wx/filefn.h" #include "wx/datetime.h" @@ -186,7 +185,7 @@ public: 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.IsEmpty() || !m_relative || + return m_dirs.size() != 0 || !m_name.empty() || !m_relative || !m_ext.empty() || m_hasExt; } @@ -367,9 +366,11 @@ public: void RemoveLastDir() { RemoveDir(GetDirCount() - 1); } // Other accessors - void SetExt( const wxString &ext ) { m_ext = ext; } + void SetExt( const wxString &ext ) { m_ext = ext; m_hasExt = !m_ext.empty(); } + void ClearExt() { m_ext = wxEmptyString; m_hasExt = false; } + void SetEmptyExt() { m_ext = wxT(""); m_hasExt = true; } wxString GetExt() const { return m_ext; } - bool HasExt() const { return !m_ext.empty(); } + bool HasExt() const { return m_hasExt; } void SetName( const wxString &name ) { m_name = name; } wxString GetName() const { return m_name; } @@ -424,7 +425,7 @@ public: wxString *path, wxString *name, wxString *ext, - wxPathFormat format = wxPATH_NATIVE) + wxPathFormat format) { SplitPath(fullpath, volume, path, name, ext, NULL, format); }