void CorruptionTestCase::CreateArchive(wxOutputStream& out) { auto_ptr<wxArchiveOutputStream> arc(m_factory->NewStream(out)); arc->PutNextDirEntry(_T("dir")); arc->PutNextEntry(_T("file")); arc->Write(_T("foo"), 3); }
void CorruptionTestCase::ExtractArchive(wxInputStream& in) { auto_ptr<wxArchiveInputStream> arc(m_factory->NewStream(in)); auto_ptr<wxArchiveEntry> entry(arc->GetNextEntry()); while (entry.get() != NULL) { char buf[1024]; while (arc->IsOk()) arc->Read(buf, sizeof(buf)); auto_ptr<wxArchiveEntry> next(arc->GetNextEntry()); entry = next; } }