X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6081a0462089eaa1da4d38b260af032b349a041..cb7acf9cc78c309026bed1038631f2663cd90bda:/src/msw/dir.cpp?ds=inline

diff --git a/src/msw/dir.cpp b/src/msw/dir.cpp
index adfa2dd7e3..7d505e56bc 100644
--- a/src/msw/dir.cpp
+++ b/src/msw/dir.cpp
@@ -215,6 +215,8 @@ public:
     void Rewind();
     bool Read(wxString *filename);
 
+    const wxString& GetName() const { return m_dirname; }
+
 private:
     FIND_DATA m_finddata;
 
@@ -403,6 +405,28 @@ bool wxDir::IsOpened() const
     return m_data != NULL;
 }
 
+wxString wxDir::GetName() const
+{
+    wxString name;
+    if ( m_data )
+    {
+        name = M_DIR->GetName();
+        if ( !name.empty() )
+        {
+            // bring to canonical Windows form
+            name.Replace(_T("/"), _T("\\"));
+
+            if ( name.Last() == _T('\\') )
+            {
+                // chop off the last (back)slash
+                name.Truncate(name.length() - 1);
+            }
+        }
+    }
+
+    return name;
+}
+
 wxDir::~wxDir()
 {
     delete M_DIR;