X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1a6255e6645bfea2c30b8a65915aa2a3479f84af..af867f957d81d1c6838c5a37992972bc9505850d:/include/wx/filename.h diff --git a/include/wx/filename.h b/include/wx/filename.h index b2abdf4569..1d4f7f66d2 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -12,15 +12,6 @@ #ifndef _WX_FILENAME_H_ #define _WX_FILENAME_H_ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "filename.h" -#endif - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/arrstr.h" -#endif - /* TODO: @@ -35,7 +26,7 @@ 3. SameFileAs() function to compare inodes under Unix */ -// ridiculously enough, this will replace DirExists with wxDirExists etc +#include "wx/arrstr.h" #include "wx/filefn.h" #include "wx/datetime.h" @@ -186,7 +177,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 +358,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; } @@ -450,7 +443,7 @@ public: { return GetPath(withSep ? wxPATH_GET_SEPARATOR : 0, format); } #endif wxString GetPathWithSep(wxPathFormat format = wxPATH_NATIVE ) const - { return GetPath(wxPATH_GET_SEPARATOR, format); } + { return GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR, format); } private: // check whether this dir is valid for Append/Prepend/InsertDir()