added wxFSFile::GetModificationTime
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
a47ce4a764
commit
6ee654e6bb
@ -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}
|
||||
|
@ -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;}
|
||||
};
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user