#include "wx/buffer.h"
#include "wx/ptr_scpd.h"
#include "wx/wfstream.h"
-#include "wx/html/forcelnk.h"
#include "zlib.h"
// value for the 'version needed to extract' field (20 means 2.0)
IMPLEMENT_DYNAMIC_CLASS(wxZipEntry, wxArchiveEntry)
IMPLEMENT_DYNAMIC_CLASS(wxZipClassFactory, wxArchiveClassFactory)
-FORCE_LINK_ME(zipstrm)
+//FORCE_LINK_ME(zipstrm)
+int _wx_link_dummy_func_zipstrm();
+int _wx_link_dummy_func_zipstrm()
+{
+ return 1;
+}
/////////////////////////////////////////////////////////////////////////////
{
public:
wxZipMemory() : m_data(NULL), m_size(0), m_capacity(0), m_ref(1) { }
- ~wxZipMemory() { delete m_data; }
wxZipMemory *AddRef() { m_ref++; return this; }
void Release() { if (--m_ref == 0) delete this; }
wxZipMemory *Unique(size_t size);
private:
+ ~wxZipMemory() { delete m_data; }
char *m_data;
size_t m_size;
{
public:
wxZipWeakLinks() : m_ref(1) { }
- ~wxZipWeakLinks() { wxASSERT(IsEmpty()); }
void Release(const wxZipInputStream* WXUNUSED(x))
{ if (--m_ref == 0) delete this; }
bool IsEmpty() const { return m_entries.empty(); }
private:
+ ~wxZipWeakLinks() { wxASSERT(IsEmpty()); }
int m_ref;
_wxOffsetZipEntryMap m_entries;
{
public:
wxZipStreamLink(wxZipOutputStream *stream) : m_ref(1), m_stream(stream) { }
- ~wxZipStreamLink() { }
wxZipStreamLink *AddRef() { m_ref++; return this; }
wxZipOutputStream *GetOutputStream() const { return m_stream; }
{ m_stream = NULL; if (--m_ref == 0) delete this; }
private:
+ ~wxZipStreamLink() { }
int m_ref;
wxZipOutputStream *m_stream;
//
bool wxZipInputStream::FindEndRecord()
{
+ if (!m_parent_i_stream->IsSeekable())
+ return false;
+
// usually it's 22 bytes in size and the last thing in the file
{
wxLogNull nolog;
ds << LOCAL_MAGIC;
// and if this is the first entry test for seekability
- if (m_headerOffset == 0) {
+ if (m_headerOffset == 0 && m_parent_o_stream->IsSeekable()) {
bool logging = wxLog::IsEnabled();
wxLogNull nolog;
wxFileOffset here = m_parent_o_stream->TellO();