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:
@@ -108,6 +108,12 @@ Returns MIME type of the content of this file. It is either
|
|||||||
extension-based (see wxMimeTypesManager) or extracted from
|
extension-based (see wxMimeTypesManager) or extracted from
|
||||||
HTTP protocol Content-Type header.
|
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}
|
\membersection{wxFSFile::GetStream}\label{wxfsfilegetstream}
|
||||||
|
|
||||||
\constfunc{wxInputStream*}{GetStream}{\void}
|
\constfunc{wxInputStream*}{GetStream}{\void}
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
#include "wx/stream.h"
|
#include "wx/stream.h"
|
||||||
#include "wx/mimetype.h"
|
#include "wx/mimetype.h"
|
||||||
#include "wx/url.h"
|
#include "wx/url.h"
|
||||||
|
#include "wx/datetime.h"
|
||||||
|
|
||||||
class wxFSFile;
|
class wxFSFile;
|
||||||
class wxFileSystemHandler;
|
class wxFileSystemHandler;
|
||||||
@@ -41,14 +41,18 @@ class WXDLLEXPORT wxFSFile : public wxObject
|
|||||||
wxString m_Location;
|
wxString m_Location;
|
||||||
wxString m_MimeType;
|
wxString m_MimeType;
|
||||||
wxString m_Anchor;
|
wxString m_Anchor;
|
||||||
|
wxDateTime m_Modif;
|
||||||
|
|
||||||
public:
|
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_Stream = stream;
|
||||||
m_Location = loc;
|
m_Location = loc;
|
||||||
m_MimeType = mimetype; m_MimeType.MakeLower();
|
m_MimeType = mimetype; m_MimeType.MakeLower();
|
||||||
m_Anchor = anchor;
|
m_Anchor = anchor;
|
||||||
|
m_Modif = modif;
|
||||||
}
|
}
|
||||||
virtual ~wxFSFile()
|
virtual ~wxFSFile()
|
||||||
{
|
{
|
||||||
@@ -66,6 +70,8 @@ class WXDLLEXPORT wxFSFile : public wxObject
|
|||||||
// returns the original location (aka filename) of the file
|
// returns the original location (aka filename) of the file
|
||||||
|
|
||||||
const wxString& GetAnchor() const {return m_Anchor;}
|
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),
|
return new wxFSFile(new wxFileInputStream(right),
|
||||||
right,
|
right,
|
||||||
GetMimeTypeFromExt(location),
|
GetMimeTypeFromExt(location),
|
||||||
GetAnchor(location));
|
GetAnchor(location),
|
||||||
|
wxDateTime(wxFileModificationTime(right)));
|
||||||
else return (wxFSFile*) NULL;
|
else return (wxFSFile*) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -126,7 +126,8 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxStri
|
|||||||
return new wxFSFile(s,
|
return new wxFSFile(s,
|
||||||
right,
|
right,
|
||||||
info->GetMime(),
|
info->GetMime(),
|
||||||
GetAnchor(location));
|
GetAnchor(location),
|
||||||
|
wxDateTime::Today());
|
||||||
}
|
}
|
||||||
else return (wxFSFile*) NULL;
|
else return (wxFSFile*) NULL;
|
||||||
}
|
}
|
||||||
|
@@ -82,7 +82,8 @@ wxFSFile* wxZipFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& l
|
|||||||
return new wxFSFile(s,
|
return new wxFSFile(s,
|
||||||
left + wxT("#zip:") + right,
|
left + wxT("#zip:") + right,
|
||||||
GetMimeTypeFromExt(location),
|
GetMimeTypeFromExt(location),
|
||||||
GetAnchor(location));
|
GetAnchor(location),
|
||||||
|
wxDateTime(wxFileModificationTime(left)));
|
||||||
}
|
}
|
||||||
else return NULL;
|
else return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user