]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dir.cpp
use MoreFilesX instead of MoreFiles when building with Apple Developer Tools
[wxWidgets.git] / src / msw / dir.cpp
index 7d505e56bc4531ca9b987010aac9bbf220f2059a..6e51506f8b68f3d61c782397ba82e7abb478ea03 100644 (file)
@@ -458,3 +458,36 @@ bool wxDir::GetNext(wxString *filename) const
 
     return M_DIR->Read(filename);
 }
+
+// ----------------------------------------------------------------------------
+// wxGetDirectoryTimes: used by wxFileName::GetTimes()
+// ----------------------------------------------------------------------------
+
+#ifdef __WIN32__
+
+extern bool
+wxGetDirectoryTimes(const wxString& dirname,
+                    FILETIME *ftAccess, FILETIME *ftCreate, FILETIME *ftMod)
+{
+    // FindFirst() is going to fail
+    wxASSERT_MSG( !dirname.empty() && dirname.Last() != _T('\\'),
+                  _T("incorrect directory name format in wxGetDirectoryTimes") );
+
+    FIND_STRUCT fs;
+    FIND_DATA fd = FindFirst(dirname, &fs);
+    if ( !IsFindDataOk(fd) )
+    {
+        return FALSE;
+    }
+
+    *ftAccess = fs.ftLastAccessTime;
+    *ftCreate = fs.ftCreationTime;
+    *ftMod = fs.ftLastWriteTime;
+
+    FindClose(fd);
+
+    return TRUE;
+}
+
+#endif // __WIN32__
+