#include "wx/wxprec.h"
-#ifdef __BORDLANDC__
+#ifdef __BORLANDC__
#pragma hdrstop
#endif
m_Data = new char[len];
memcpy(m_Data, data, len);
m_Len = len;
- m_Time = wxDateTime::Now();
+ InitTime();
}
MemFSHashObj(wxMemoryOutputStream& stream)
m_Len = stream.GetSize();
m_Data = new char[m_Len];
stream.CopyTo(m_Data, m_Len);
- m_Time = wxDateTime::Now();
+ InitTime();
}
~MemFSHashObj()
char *m_Data;
size_t m_Len;
+#if wxUSE_DATETIME
wxDateTime m_Time;
+#endif // wxUSE_DATETIME
+
+ DECLARE_NO_COPY_CLASS(MemFSHashObj)
+
+ private:
+ void InitTime()
+ {
+#if wxUSE_DATETIME
+ m_Time = wxDateTime::Now();
+#endif // wxUSE_DATETIME
+ }
};
wxMemoryFSHandler::wxMemoryFSHandler() : wxFileSystemHandler()
{
- m_Hash = NULL;
}
else return new wxFSFile(new wxMemoryInputStream(obj -> m_Data, obj -> m_Len),
location,
GetMimeTypeFromExt(location),
- GetAnchor(location),
- obj -> m_Time);
+ GetAnchor(location)
+#if wxUSE_DATETIME
+ , obj -> m_Time
+#endif // wxUSE_DATETIME
+ );
}
else return NULL;
}
/*static*/ void wxMemoryFSHandler::AddFile(const wxString& filename, const wxBitmap& bitmap, long type)
{
- wxImage img(bitmap);
+ wxImage img = bitmap.ConvertToImage();
AddFile(filename, img, type);
}