X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4cbfec1580bb0e546744fbe07675f8fba1ad49f2..7447d53c35249d42128d6243c90998f03882859a:/docs/doxygen/overviews/archive.h diff --git a/docs/doxygen/overviews/archive.h b/docs/doxygen/overviews/archive.h index 69aabb55dd..6be6b783c3 100644 --- a/docs/doxygen/overviews/archive.h +++ b/docs/doxygen/overviews/archive.h @@ -3,7 +3,7 @@ // Purpose: topic overview // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -11,7 +11,7 @@ @page overview_archive Archive Formats The archive classes handle archive formats such as zip, tar, rar and cab. -Currently wxZip and wxTar classes are included. +Currently wxZip, wxTar and wxZlib classes are included. For each archive type, there are the following classes (using zip here as an example): @@ -50,16 +50,16 @@ archive, then write the entry's data. Another call to PutNextEntry() closes the current entry and begins the next. For example: @code -wxFFileOutputStream out(_T("test.zip")); +wxFFileOutputStream out(wxT("test.zip")); wxZipOutputStream zip(out); wxTextOutputStream txt(zip); wxString sep(wxFileName::GetPathSeparator()); -zip.PutNextEntry(_T("entry1.txt")); -txt << _T("Some text for entry1.txt\n"); +zip.PutNextEntry(wxT("entry1.txt")); +txt << wxT("Some text for entry1.txt\n"); -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"); @endcode The name of each entry can be a full path, which makes it possible to store @@ -80,7 +80,7 @@ When there are no more entries, GetNextEntry() returns @NULL and sets Eof(). @code auto_ptr entry; -wxFFileInputStream in(_T("test.zip")); +wxFFileInputStream in(wxT("test.zip")); wxZipInputStream zip(in); while (entry.reset(zip.GetNextEntry()), entry.get() != NULL) @@ -111,8 +111,8 @@ archive. wxTempFileOutputStream can be helpful to do this. For example to delete all entries matching the pattern "*.txt": @code -auto_ptr in(new wxFFileInputStream(_T("test.zip"))); -wxTempFileOutputStream out(_T("test.zip")); +auto_ptr in(new wxFFileInputStream(wxT("test.zip"))); +wxTempFileOutputStream out(wxT("test.zip")); wxZipInputStream inzip(*in); wxZipOutputStream outzip(out); @@ -125,7 +125,7 @@ outzip.CopyArchiveMetaData(inzip); // call CopyEntry for each entry except those matching the pattern while (entry.reset(inzip.GetNextEntry()), entry.get() != NULL) - if (!entry->GetName().Matches(_T("*.txt"))) + if (!entry->GetName().Matches(wxT("*.txt"))) if (!outzip.CopyEntry(entry.release(), inzip)) break; @@ -167,7 +167,7 @@ auto_ptr entry; wxString name = wxZipEntry::GetInternalName(localname); // open the zip -wxFFileInputStream in(_T("test.zip")); +wxFFileInputStream in(wxT("test.zip")); wxZipInputStream zip(in); // call GetNextEntry() until the required internal name is found @@ -195,7 +195,7 @@ wxZipEntry *entry; ZipCatalog cat; // open the zip -wxFFileInputStream in(_T("test.zip")); +wxFFileInputStream in(wxT("test.zip")); wxZipInputStream zip(in); // load the zip catalog @@ -222,7 +222,7 @@ stream on the same archive: @code // opening another entry without closing the first requires another // input stream for the same file -wxFFileInputStream in2(_T("test.zip")); +wxFFileInputStream in2(wxT("test.zip")); wxZipInputStream zip2(in2); if ((it = cat.find(wxZipEntry::GetInternalName(local2))) != cat.end()) zip2.OpenEntry(*it->second); @@ -311,7 +311,7 @@ if (in->IsOk()) } else { - wxLogError(_T("can't handle '%s'"), filename.c_str()); + wxLogError(wxT("can't handle '%s'"), filename.c_str()); } } @endcode @@ -361,7 +361,7 @@ attempts to update it if it is still around. 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 -fully populated when GetNextEntry() returns, with the the following exceptions: +fully populated when GetNextEntry() returns, with the following exceptions: @li wxArchiveEntry::GetSize(): Guaranteed to be available after the entry has been read to wxInputStream::Eof(), or wxArchiveInputStream::CloseEntry()