X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/353327844e319db755c2e7a07a4cf5b53cef35c4..f77cf4e68a98b10378ab07c1c591464b89656102:/src/msw/dir.cpp?ds=sidebyside diff --git a/src/msw/dir.cpp b/src/msw/dir.cpp index 7d505e56bc..273734724d 100644 --- a/src/msw/dir.cpp +++ b/src/msw/dir.cpp @@ -224,6 +224,8 @@ private: wxString m_filespec; int m_flags; + + DECLARE_NO_COPY_CLASS(wxDirData) }; // ============================================================================ @@ -458,3 +460,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__ +