@page overview_archive Archive Formats
The archive classes handle archive formats such as zip, tar, rar and cab.
@page overview_archive Archive Formats
The archive classes handle archive formats such as zip, tar, rar and cab.
wxZipOutputStream zip(out);
wxTextOutputStream txt(zip);
wxString sep(wxFileName::GetPathSeparator());
wxZipOutputStream zip(out);
wxTextOutputStream txt(zip);
wxString sep(wxFileName::GetPathSeparator());
-zip.PutNextEntry(_T("subdir") + sep + _T("entry2.txt"));
-txt << _T("Some text for subdir/entry2.txt\n");
+zip.PutNextEntry(wxT("subdir") + sep + wxT("entry2.txt"));
+txt << wxT("Some text for subdir/entry2.txt\n");
wxZipInputStream zip(in);
while (entry.reset(zip.GetNextEntry()), entry.get() != NULL)
wxZipInputStream zip(in);
while (entry.reset(zip.GetNextEntry()), entry.get() != NULL)
-auto_ptr<wxFFileInputStream> in(new wxFFileInputStream(_T("test.zip")));
-wxTempFileOutputStream out(_T("test.zip"));
+auto_ptr<wxFFileInputStream> in(new wxFFileInputStream(wxT("test.zip")));
+wxTempFileOutputStream out(wxT("test.zip"));
// call CopyEntry for each entry except those matching the pattern
while (entry.reset(inzip.GetNextEntry()), entry.get() != NULL)
// call CopyEntry for each entry except those matching the pattern
while (entry.reset(inzip.GetNextEntry()), entry.get() != NULL)
@code
// opening another entry without closing the first requires another
// input stream for the same file
@code
// opening another entry without closing the first requires another
// input stream for the same file
wxZipInputStream zip2(in2);
if ((it = cat.find(wxZipEntry::GetInternalName(local2))) != cat.end())
zip2.OpenEntry(*it->second);
wxZipInputStream zip2(in2);
if ((it = cat.find(wxZipEntry::GetInternalName(local2))) != cat.end())
zip2.OpenEntry(*it->second);
The documentation for each archive entry type gives the details of what
meta-data becomes available and when. For generic programming, when the worst
case must be assumed, you can rely on all the fields of wxArchiveEntry being
The documentation for each archive entry type gives the details of what
meta-data becomes available and when. For generic programming, when the worst
case must be assumed, you can rely on all the fields of wxArchiveEntry being
@li wxArchiveEntry::GetSize(): Guaranteed to be available after the entry has
been read to wxInputStream::Eof(), or wxArchiveInputStream::CloseEntry()
@li wxArchiveEntry::GetSize(): Guaranteed to be available after the entry has
been read to wxInputStream::Eof(), or wxArchiveInputStream::CloseEntry()