- public:
-
- MemFSHashObj(const void *data, size_t len)
- {
- m_Data = new char[len];
- memcpy(m_Data, data, len);
- m_Len = len;
- m_Time = wxDateTime::Now();
- }
-
- MemFSHashObj(wxMemoryOutputStream& stream)
- {
- m_Len = stream.GetSize();
- m_Data = new char[m_Len];
- stream.CopyTo(m_Data, m_Len);
- m_Time = wxDateTime::Now();
- }
-
- ~MemFSHashObj()
- {
- delete[] m_Data;
- }
-
- char *m_Data;
- size_t m_Len;
- wxDateTime m_Time;
+public:
+ wxMemoryFSFile(const void *data, size_t len, const wxString& mime)
+ {
+ m_Data = new char[len];
+ memcpy(m_Data, data, len);
+ m_Len = len;
+ m_MimeType = mime;
+ InitTime();
+ }
+
+ wxMemoryFSFile(const wxMemoryOutputStream& stream, const wxString& mime)
+ {
+ m_Len = stream.GetSize();
+ m_Data = new char[m_Len];
+ stream.CopyTo(m_Data, m_Len);
+ m_MimeType = mime;
+ InitTime();
+ }
+
+ virtual ~wxMemoryFSFile()
+ {
+ delete[] m_Data;
+ }
+
+ char *m_Data;
+ size_t m_Len;
+ wxString m_MimeType;
+#if wxUSE_DATETIME
+ wxDateTime m_Time;
+#endif // wxUSE_DATETIME
+
+private:
+ void InitTime()
+ {
+#if wxUSE_DATETIME
+ m_Time = wxDateTime::Now();
+#endif // wxUSE_DATETIME
+ }
+
+ wxDECLARE_NO_COPY_CLASS(wxMemoryFSFile);