// Created: 08.12.99
// RCS-ID: $Id$
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "dir.h"
#endif
#include "wx/dir.h"
#include "wx/filefn.h" // for wxPathExists()
+#ifdef __WXMSW__
+ #include "wx/msw/private.h"
+#endif
+
// ----------------------------------------------------------------------------
// define the types and functions used for file searching
// ----------------------------------------------------------------------------
return (attr & (_A_SYSTEM | _A_HIDDEN)) != 0;
}
#else // Win32
- #include <windows.h>
-
typedef WIN32_FIND_DATA FIND_STRUCT;
typedef HANDLE FIND_DATA;
typedef DWORD FIND_ATTR;
wxString m_filespec;
int m_flags;
+
+ DECLARE_NO_COPY_CLASS(wxDirData)
};
// ============================================================================
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__
+