]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxFSFile::GetModificationTime
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 19 Jan 2000 01:00:47 +0000 (01:00 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 19 Jan 2000 01:00:47 +0000 (01:00 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/fsfile.tex
include/wx/filesys.h
src/common/filesys.cpp
src/common/fs_inet.cpp
src/common/fs_zip.cpp

index 0085ae2a6240150647fc99c2acde650fa64f1b8b..1da9827a32dd078a3c480dd0607e7cfebde54fe7 100644 (file)
@@ -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}
index fa3d23d5dbe80ab26008146d8dcd302fe0553c6b..a9b64d166724b44c4befbaa2de984dbcfdb0beed 100644 (file)
@@ -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;}
 };
 
 
index e7b83b9b21fa5d4eb833b081ca7648e1d9ac01d0..159c29c6db40efe5dc09a66878e76a244b4e1ee6 100644 (file)
@@ -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;
 }
 
index 4a06c7c46010ae4c9d5c7d42c11f00ae0c0b64eb..6c2eeb52e22ea43d8636312be6d209f48c3155ab 100644 (file)
@@ -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;
 }
index d390e17df0ea5120e0595d2311c8fe172ec5a280..a1ad5cd8f3085af3c76394766c38e99c8fee0183 100644 (file)
@@ -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;
 }