Adapt SetExt() to new availability of m_hasExt. I also
authorRobert Roebling <robert@roebling.de>
Thu, 3 Mar 2005 19:45:24 +0000 (19:45 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 3 Mar 2005 19:45:24 +0000 (19:45 +0000)
   added SetNoExt() as there needs to be a way to remove
   the extension. One wonders what SetExt( "" ) is supposed
   to do. Maybe adding SetEmptyExt() would be better and
   backwards compatible.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/filename.h

index b2abdf4569cbbee195ff4e379f0bceb9462f3878..95cbb18de5cee46e0feda1de5ccafc1bc3865cf7 100644 (file)
@@ -367,9 +367,10 @@ 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 = true; }
+    void SetNoExt()                             { m_ext = wxEmptyString; m_hasExt = false; }
     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; }