예제 #1
0
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);
}
예제 #2
0
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;
    }
}