]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
no changes
[wxWidgets.git] / src / common / filename.cpp
index e0c45c36ff3b733648c2b6073eaeb87baa7c1d47..3bb86945343298d5d9853574aee1b3f9013117e4 100644 (file)
@@ -249,7 +249,7 @@ bool wxFileName::Normalize(wxPathNormalize flags,
             {
                 curDir.AssignDir(wxGetUserHome(dir.c_str() + 1));
 
-                dirs.Remove(0u);
+                dirs.RemoveAt(0u);
             }
         }
     }
@@ -432,6 +432,11 @@ void wxFileName::RemoveDir( int pos )
 // accessors
 // ----------------------------------------------------------------------------
 
+void wxFileName::SetFullName(const wxString& fullname)
+{
+    SplitPath(fullname, NULL /* no path */, &m_name, &m_ext);
+}
+
 wxString wxFileName::GetFullName() const
 {
     wxString fullname = m_name;
@@ -530,9 +535,12 @@ void wxFileName::SplitPath(const wxString& fullpath,
 
     if ( pstrName )
     {
+        // take all characters starting from the one after the last slash and
+        // up to, but excluding, the last dot
         size_t nStart = posLastSlash == wxString::npos ? 0 : posLastSlash + 1;
-        size_t count = posLastDot == wxString::npos ? wxString::npos
-                                                    : posLastDot - posLastSlash;
+        size_t count = posLastDot == wxString::npos
+                        ? wxString::npos
+                        : posLastDot - posLastSlash - 1;
 
         *pstrName = fullpath.Mid(nStart, count);
     }