From 6ee654e6bb28d20841d115f667239739e3ac42ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 19 Jan 2000 01:00:47 +0000 Subject: [PATCH] added wxFSFile::GetModificationTime git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/fsfile.tex | 6 ++++++ include/wx/filesys.h | 10 ++++++++-- src/common/filesys.cpp | 3 ++- src/common/fs_inet.cpp | 3 ++- src/common/fs_zip.cpp | 3 ++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/latex/wx/fsfile.tex b/docs/latex/wx/fsfile.tex index 0085ae2a62..1da9827a32 100644 --- a/docs/latex/wx/fsfile.tex +++ b/docs/latex/wx/fsfile.tex @@ -108,6 +108,12 @@ Returns MIME type of the content of this file. It is either extension-based (see wxMimeTypesManager) or extracted from HTTP protocol Content-Type header. +\membersection{wxFSFile::GetModificationTime}\label{wxfsfilegetmodificationtime} + +\constfunc{wxDateTime}{GetModificationTime}{\void} + +Returns time when this file was modified. + \membersection{wxFSFile::GetStream}\label{wxfsfilegetstream} \constfunc{wxInputStream*}{GetStream}{\void} diff --git a/include/wx/filesys.h b/include/wx/filesys.h index fa3d23d5db..a9b64d1667 100644 --- a/include/wx/filesys.h +++ b/include/wx/filesys.h @@ -21,7 +21,7 @@ #include "wx/stream.h" #include "wx/mimetype.h" #include "wx/url.h" - +#include "wx/datetime.h" class wxFSFile; class wxFileSystemHandler; @@ -41,14 +41,18 @@ class WXDLLEXPORT wxFSFile : public wxObject wxString m_Location; wxString m_MimeType; wxString m_Anchor; + wxDateTime m_Modif; public: - wxFSFile(wxInputStream *stream, const wxString& loc, const wxString& mimetype, const wxString& anchor) + wxFSFile(wxInputStream *stream, const wxString& loc, + const wxString& mimetype, const wxString& anchor, + wxDateTime modif) { m_Stream = stream; m_Location = loc; m_MimeType = mimetype; m_MimeType.MakeLower(); m_Anchor = anchor; + m_Modif = modif; } virtual ~wxFSFile() { @@ -66,6 +70,8 @@ class WXDLLEXPORT wxFSFile : public wxObject // returns the original location (aka filename) of the file const wxString& GetAnchor() const {return m_Anchor;} + + wxDateTime GetModificationTime() const {return m_Modif;} }; diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index e7b83b9b21..159c29c6db 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -198,7 +198,8 @@ wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& return new wxFSFile(new wxFileInputStream(right), right, GetMimeTypeFromExt(location), - GetAnchor(location)); + GetAnchor(location), + wxDateTime(wxFileModificationTime(right))); else return (wxFSFile*) NULL; } diff --git a/src/common/fs_inet.cpp b/src/common/fs_inet.cpp index 4a06c7c460..6c2eeb52e2 100644 --- a/src/common/fs_inet.cpp +++ b/src/common/fs_inet.cpp @@ -126,7 +126,8 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxStri return new wxFSFile(s, right, info->GetMime(), - GetAnchor(location)); + GetAnchor(location), + wxDateTime::Today()); } else return (wxFSFile*) NULL; } diff --git a/src/common/fs_zip.cpp b/src/common/fs_zip.cpp index d390e17df0..a1ad5cd8f3 100644 --- a/src/common/fs_zip.cpp +++ b/src/common/fs_zip.cpp @@ -82,7 +82,8 @@ wxFSFile* wxZipFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& l return new wxFSFile(s, left + wxT("#zip:") + right, GetMimeTypeFromExt(location), - GetAnchor(location)); + GetAnchor(location), + wxDateTime(wxFileModificationTime(left))); } else return NULL; } -- 2.45.2