source: s10k/CommonLibs/quazip-0.7.2/doc/latex/classQuaZip.tex@ 1127

Last change on this file since 1127 was 1096, checked in by s10k, 7 years ago

Added zlib, quazip, basicxmlsyntaxhighlighter, conditionalsemaphore and linenumberdisplay libraries. zlib and quazip are pre-compiled, but you can compile them yourself, just delete the dll files (or equivalent binary files to your OS)

File size: 52.9 KB
RevLine 
[1096]1\section{QuaZip Class Reference}
2\label{classQuaZip}\index{QuaZip@{QuaZip}}
3
4
5ZIP archive.
6
7
8
9
10{\ttfamily \#include $<$quazip/quazip.h$>$}
11
12
13
14Collaboration diagram for QuaZip:
15\nopagebreak
16\begin{figure}[H]
17\begin{center}
18\leavevmode
19\includegraphics[width=400pt]{classQuaZip__coll__graph}
20\end{center}
21\end{figure}
22\subsection*{Public Types}
23\begin{DoxyCompactItemize}
24\item
25enum {\bf Constants} \{ {\bf MAX\_\-FILE\_\-NAME\_\-LENGTH} = 256
26 \}
27\begin{DoxyCompactList}\small\item\em Useful constants. \end{DoxyCompactList}\item
28enum {\bf Mode} \{ \par
29{\bf mdNotOpen},
30{\bf mdUnzip},
31{\bf mdCreate},
32{\bf mdAppend},
33\par
34{\bf mdAdd}
35 \}
36\begin{DoxyCompactList}\small\item\em Open mode of the ZIP file. \end{DoxyCompactList}\item
37enum {\bf CaseSensitivity} \{ {\bf csDefault} = 0,
38{\bf csSensitive} = 1,
39{\bf csInsensitive} = 2
40 \}
41\begin{DoxyCompactList}\small\item\em Case sensitivity for the file names. \end{DoxyCompactList}\end{DoxyCompactItemize}
42\subsection*{Public Member Functions}
43\begin{DoxyCompactItemize}
44\item
45{\bf QuaZip} ()
46\begin{DoxyCompactList}\small\item\em Constructs \doxyref{QuaZip}{p.}{classQuaZip} object. \end{DoxyCompactList}\item
47{\bf QuaZip} (const {\bf QString} \&zipName)\label{classQuaZip_aaea7294b02abd22379cc3a9fccb754b7}
48
49\begin{DoxyCompactList}\small\item\em Constructs \doxyref{QuaZip}{p.}{classQuaZip} object associated with ZIP file {\itshape zipName\/}. \end{DoxyCompactList}\item
50{\bf QuaZip} ({\bf QIODevice} $\ast$ioDevice)
51\begin{DoxyCompactList}\small\item\em Constructs \doxyref{QuaZip}{p.}{classQuaZip} object associated with ZIP file represented by {\itshape ioDevice\/}. \end{DoxyCompactList}\item
52{\bf $\sim$QuaZip} ()
53\begin{DoxyCompactList}\small\item\em Destroys \doxyref{QuaZip}{p.}{classQuaZip} object. \end{DoxyCompactList}\item
54bool {\bf open} ({\bf Mode} mode, zlib\_\-filefunc\_\-def $\ast$ioApi=NULL)
55\begin{DoxyCompactList}\small\item\em Opens ZIP file. \end{DoxyCompactList}\item
56void {\bf close} ()
57\begin{DoxyCompactList}\small\item\em Closes ZIP file. \end{DoxyCompactList}\item
58void {\bf setFileNameCodec} ({\bf QTextCodec} $\ast$fileNameCodec)
59\begin{DoxyCompactList}\small\item\em Sets the codec used to encode/decode file names inside archive. \end{DoxyCompactList}\item
60void {\bf setFileNameCodec} (const char $\ast$fileNameCodecName)
61\begin{DoxyCompactList}\small\item\em Sets the codec used to encode/decode file names inside archive. \end{DoxyCompactList}\item
62{\bf QTextCodec} $\ast$ {\bf getFileNameCodec} () const \label{classQuaZip_a27b866aa2c75ea6f9c438cbb6e32b43c}
63
64\begin{DoxyCompactList}\small\item\em Returns the codec used to encode/decode comments inside archive. \end{DoxyCompactList}\item
65void {\bf setCommentCodec} ({\bf QTextCodec} $\ast$commentCodec)
66\begin{DoxyCompactList}\small\item\em Sets the codec used to encode/decode comments inside archive. \end{DoxyCompactList}\item
67void {\bf setCommentCodec} (const char $\ast$commentCodecName)
68\begin{DoxyCompactList}\small\item\em Sets the codec used to encode/decode comments inside archive. \end{DoxyCompactList}\item
69{\bf QTextCodec} $\ast$ {\bf getCommentCodec} () const \label{classQuaZip_a008260161781d8b5d2a0a28493fddaf4}
70
71\begin{DoxyCompactList}\small\item\em Returns the codec used to encode/decode comments inside archive. \end{DoxyCompactList}\item
72{\bf QString} {\bf getZipName} () const
73\begin{DoxyCompactList}\small\item\em Returns the name of the ZIP file. \end{DoxyCompactList}\item
74void {\bf setZipName} (const {\bf QString} \&zipName)
75\begin{DoxyCompactList}\small\item\em Sets the name of the ZIP file. \end{DoxyCompactList}\item
76{\bf QIODevice} $\ast$ {\bf getIoDevice} () const
77\begin{DoxyCompactList}\small\item\em Returns the device representing this ZIP file. \end{DoxyCompactList}\item
78void {\bf setIoDevice} ({\bf QIODevice} $\ast$ioDevice)
79\begin{DoxyCompactList}\small\item\em Sets the device representing the ZIP file. \end{DoxyCompactList}\item
80{\bf Mode} {\bf getMode} () const \label{classQuaZip_a129ceff04d28fb00531f7bf7f9329664}
81
82\begin{DoxyCompactList}\small\item\em Returns the mode in which ZIP file was opened. \end{DoxyCompactList}\item
83bool {\bf isOpen} () const \label{classQuaZip_a5b869a9c0d4f49955b759592fec08888}
84
85\begin{DoxyCompactList}\small\item\em Returns {\ttfamily true} if ZIP file is open, {\ttfamily false} otherwise. \end{DoxyCompactList}\item
86int {\bf getZipError} () const
87\begin{DoxyCompactList}\small\item\em Returns the error code of the last operation. \end{DoxyCompactList}\item
88int {\bf getEntriesCount} () const
89\begin{DoxyCompactList}\small\item\em Returns number of the entries in the ZIP central directory. \end{DoxyCompactList}\item
90{\bf QString} {\bf getComment} () const \label{classQuaZip_ae55cfbf2296132df808c557b62433051}
91
92\begin{DoxyCompactList}\small\item\em Returns global comment in the ZIP file. \end{DoxyCompactList}\item
93void {\bf setComment} (const {\bf QString} \&comment)
94\begin{DoxyCompactList}\small\item\em Sets the global comment in the ZIP file. \end{DoxyCompactList}\item
95bool {\bf goToFirstFile} ()
96\begin{DoxyCompactList}\small\item\em Sets the current file to the first file in the archive. \end{DoxyCompactList}\item
97bool {\bf goToNextFile} ()
98\begin{DoxyCompactList}\small\item\em Sets the current file to the next file in the archive. \end{DoxyCompactList}\item
99bool {\bf setCurrentFile} (const {\bf QString} \&fileName, {\bf CaseSensitivity} cs=csDefault)
100\begin{DoxyCompactList}\small\item\em Sets current file by its name. \end{DoxyCompactList}\item
101bool {\bf hasCurrentFile} () const \label{classQuaZip_a00b237d926648f45da86db25e7cfb697}
102
103\begin{DoxyCompactList}\small\item\em Returns {\ttfamily true} if the current file has been set. \end{DoxyCompactList}\item
104bool {\bf getCurrentFileInfo} ({\bf QuaZipFileInfo} $\ast$info) const
105\begin{DoxyCompactList}\small\item\em Retrieves information about the current file. \end{DoxyCompactList}\item
106bool {\bf getCurrentFileInfo} ({\bf QuaZipFileInfo64} $\ast$info) const
107\begin{DoxyCompactList}\small\item\em Retrieves information about the current file. \end{DoxyCompactList}\item
108{\bf QString} {\bf getCurrentFileName} () const
109\begin{DoxyCompactList}\small\item\em Returns the current file name. \end{DoxyCompactList}\item
110unzFile {\bf getUnzFile} ()
111\begin{DoxyCompactList}\small\item\em Returns {\ttfamily unzFile} handle. \end{DoxyCompactList}\item
112zipFile {\bf getZipFile} ()
113\begin{DoxyCompactList}\small\item\em Returns {\ttfamily zipFile} handle. \end{DoxyCompactList}\item
114void {\bf setDataDescriptorWritingEnabled} (bool enabled)
115\begin{DoxyCompactList}\small\item\em Changes the data descriptor writing mode. \end{DoxyCompactList}\item
116bool {\bf isDataDescriptorWritingEnabled} () const
117\begin{DoxyCompactList}\small\item\em Returns the data descriptor default writing mode. \end{DoxyCompactList}\item
118{\bf QStringList} {\bf getFileNameList} () const
119\begin{DoxyCompactList}\small\item\em Returns a list of files inside the archive. \end{DoxyCompactList}\item
120{\bf QList}$<$ {\bf QuaZipFileInfo} $>$ {\bf getFileInfoList} () const
121\begin{DoxyCompactList}\small\item\em Returns information list about all files inside the archive. \end{DoxyCompactList}\item
122{\bf QList}$<$ {\bf QuaZipFileInfo64} $>$ {\bf getFileInfoList64} () const
123\begin{DoxyCompactList}\small\item\em Returns information list about all files inside the archive. \end{DoxyCompactList}\item
124void {\bf setZip64Enabled} (bool zip64)
125\begin{DoxyCompactList}\small\item\em Enables the zip64 mode. \end{DoxyCompactList}\item
126bool {\bf isZip64Enabled} () const
127\begin{DoxyCompactList}\small\item\em Returns whether the zip64 mode is enabled. \end{DoxyCompactList}\item
128bool {\bf isAutoClose} () const
129\begin{DoxyCompactList}\small\item\em Returns the auto-\/close flag. \end{DoxyCompactList}\item
130void {\bf setAutoClose} (bool autoClose) const
131\begin{DoxyCompactList}\small\item\em Sets or unsets the auto-\/close flag. \end{DoxyCompactList}\end{DoxyCompactItemize}
132\subsection*{Static Public Member Functions}
133\begin{DoxyCompactItemize}
134\item
135static Qt::CaseSensitivity {\bf convertCaseSensitivity} ({\bf CaseSensitivity} cs)
136\begin{DoxyCompactList}\small\item\em Returns the actual case sensitivity for the specified QuaZIP one. \end{DoxyCompactList}\item
137static void {\bf setDefaultFileNameCodec} ({\bf QTextCodec} $\ast$codec)
138\begin{DoxyCompactList}\small\item\em Sets the default file name codec to use. \end{DoxyCompactList}\item
139static void {\bf setDefaultFileNameCodec} (const char $\ast$codecName)
140\end{DoxyCompactItemize}
141\subsection*{Friends}
142\begin{DoxyCompactItemize}
143\item
144class {\bf QuaZipPrivate}\label{classQuaZip_a5d400b33a69412e9d419a484aaf476cd}
145
146\end{DoxyCompactItemize}
147
148
149\subsection{Detailed Description}
150ZIP archive.
151
152This class implements basic interface to the ZIP archive. It can be used to read table contents of the ZIP archive and retreiving information about the files inside it.
153
154You can also use this class to open files inside archive by passing pointer to the instance of this class to the constructor of the \doxyref{QuaZipFile}{p.}{classQuaZipFile} class. But see \doxyref{QuaZipFile::QuaZipFile(QuaZip$\ast$, QObject$\ast$)}{p.}{classQuaZipFile_a54e944a6b3d27030f64c8f30d2cc33bb} for the possible pitfalls.
155
156This class is indended to provide interface to the ZIP subpackage of the ZIP/UNZIP package as well as to the UNZIP subpackage. But currently it supports only UNZIP.
157
158The use of this class is simple -\/ just create instance using constructor, then set ZIP archive file name using setFile() function (if you did not passed the name to the constructor), then \doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} and then use different functions to work with it! Well, if you are paranoid, you may also wish to call close before destructing the instance, to check for errors on close.
159
160You may also use \doxyref{getUnzFile()}{p.}{classQuaZip_a3b78a652f296ff4a678a791e8294e642} and \doxyref{getZipFile()}{p.}{classQuaZip_a425043a4d7cc31e2fe2bba73d954f15c} functions to get the ZIP archive handle and use it with ZIP/UNZIP package API directly.
161
162This class supports localized file names inside ZIP archive, but you have to set up proper codec with setCodec() function. By default, locale codec will be used, which is probably ok for UNIX systems, but will almost certainly fail with ZIP archives created in Windows. This is because Windows ZIP programs have strange habit of using DOS encoding for file names in ZIP archives. For example, ZIP archive with cyrillic names created in Windows will have file names in {\ttfamily IBM866} encoding instead of {\ttfamily WINDOWS-\/1251}. I think that calling one function is not much trouble, but for true platform independency it would be nice to have some mechanism for file name encoding auto detection using locale information. Does anyone know a good way to do it?
163
164\subsection{Member Enumeration Documentation}
165\index{QuaZip@{QuaZip}!Constants@{Constants}}
166\index{Constants@{Constants}!QuaZip@{QuaZip}}
167\subsubsection[{Constants}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf QuaZip::Constants}}\label{classQuaZip_adce46b942c341dbb5c851eadead65459}
168
169
170Useful constants.
171
172\begin{Desc}
173\item[Enumerator: ]\par
174\begin{description}
175\index{MAX\_\-FILE\_\-NAME\_\-LENGTH@{MAX\_\-FILE\_\-NAME\_\-LENGTH}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!MAX\_\-FILE\_\-NAME\_\-LENGTH@{MAX\_\-FILE\_\-NAME\_\-LENGTH}}\item[{\em
176MAX\_\-FILE\_\-NAME\_\-LENGTH\label{classQuaZip_adce46b942c341dbb5c851eadead65459ab26ce1a9c9e94f901dc2cf90fa5baa4b}
177}]Maximum file name length. Taken from {\ttfamily UNZ\_\-MAXFILENAMEINZIP} constant in unzip.c. \end{description}
178\end{Desc}
179
180\index{QuaZip@{QuaZip}!Mode@{Mode}}
181\index{Mode@{Mode}!QuaZip@{QuaZip}}
182\subsubsection[{Mode}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf QuaZip::Mode}}\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4}
183
184
185Open mode of the ZIP file.
186
187\begin{Desc}
188\item[Enumerator: ]\par
189\begin{description}
190\index{mdNotOpen@{mdNotOpen}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!mdNotOpen@{mdNotOpen}}\item[{\em
191mdNotOpen\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4ac87ddb1e901e1ec700c16ee0d4d398ce}
192}]ZIP file is not open. This is the initial mode. \index{mdUnzip@{mdUnzip}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!mdUnzip@{mdUnzip}}\item[{\em
193mdUnzip\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a803a371910c2dc830d111e9ce5b58897}
194}]ZIP file is open for reading files inside it. \index{mdCreate@{mdCreate}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!mdCreate@{mdCreate}}\item[{\em
195mdCreate\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a25ae05b12590540af8c66ae8298b928e}
196}]ZIP file was created with \doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} call. \index{mdAppend@{mdAppend}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!mdAppend@{mdAppend}}\item[{\em
197mdAppend\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4ab807f0c65653a16d77b365801fd25582}
198}]ZIP file was opened in append mode. This refers to {\ttfamily APPEND\_\-STATUS\_\-CREATEAFTER} mode in ZIP/UNZIP package and means that zip is appended to some existing file what is useful when that file contains self-\/extractor code. This is obviously {\itshape not\/} what you whant to use to add files to the existing ZIP archive. \index{mdAdd@{mdAdd}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!mdAdd@{mdAdd}}\item[{\em
199mdAdd\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a22c745f349f06add449af523254fdaec}
200}]ZIP file was opened for adding files in the archive. \end{description}
201\end{Desc}
202
203\index{QuaZip@{QuaZip}!CaseSensitivity@{CaseSensitivity}}
204\index{CaseSensitivity@{CaseSensitivity}!QuaZip@{QuaZip}}
205\subsubsection[{CaseSensitivity}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf QuaZip::CaseSensitivity}}\label{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbe}
206
207
208Case sensitivity for the file names.
209
210This is what you specify when accessing files in the archive. Works perfectly fine with any characters thanks to Qt's great unicode support. This is different from ZIP/UNZIP API, where only US-\/ASCII characters was supported. \begin{Desc}
211\item[Enumerator: ]\par
212\begin{description}
213\index{csDefault@{csDefault}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!csDefault@{csDefault}}\item[{\em
214csDefault\label{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbeac3cca8c0b976cf6397a28a5c84e75253}
215}]Default for platform. Case sensitive for UNIX, not for Windows. \index{csSensitive@{csSensitive}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!csSensitive@{csSensitive}}\item[{\em
216csSensitive\label{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbead8d86b0c34203336cad09348cfa5356e}
217}]Case sensitive. \index{csInsensitive@{csInsensitive}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!csInsensitive@{csInsensitive}}\item[{\em
218csInsensitive\label{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbea3e492bcc3f64f41a74906cecc45fb366}
219}]Case insensitive. \end{description}
220\end{Desc}
221
222
223
224\subsection{Constructor \& Destructor Documentation}
225\index{QuaZip@{QuaZip}!QuaZip@{QuaZip}}
226\index{QuaZip@{QuaZip}!QuaZip@{QuaZip}}
227\subsubsection[{QuaZip}]{\setlength{\rightskip}{0pt plus 5cm}QuaZip::QuaZip (
228\begin{DoxyParamCaption}
229{}
230\end{DoxyParamCaption}
231)}\label{classQuaZip_a970e0f401c7cfd7a78e78572f758eec4}
232
233
234Constructs \doxyref{QuaZip}{p.}{classQuaZip} object.
235
236Call setName() before opening constructed object. \index{QuaZip@{QuaZip}!QuaZip@{QuaZip}}
237\index{QuaZip@{QuaZip}!QuaZip@{QuaZip}}
238\subsubsection[{QuaZip}]{\setlength{\rightskip}{0pt plus 5cm}QuaZip::QuaZip (
239\begin{DoxyParamCaption}
240\item[{{\bf QIODevice} $\ast$}]{ioDevice}
241\end{DoxyParamCaption}
242)}\label{classQuaZip_ae52ebadd5ce64cdb49d7e198904b0b8c}
243
244
245Constructs \doxyref{QuaZip}{p.}{classQuaZip} object associated with ZIP file represented by {\itshape ioDevice\/}.
246
247The IO device must be seekable, otherwise an error will occur when opening. \index{QuaZip@{QuaZip}!$\sim$QuaZip@{$\sim$QuaZip}}
248\index{$\sim$QuaZip@{$\sim$QuaZip}!QuaZip@{QuaZip}}
249\subsubsection[{$\sim$QuaZip}]{\setlength{\rightskip}{0pt plus 5cm}QuaZip::$\sim$QuaZip (
250\begin{DoxyParamCaption}
251{}
252\end{DoxyParamCaption}
253)}\label{classQuaZip_af60a2d3930b90f3b25a3148baecad81e}
254
255
256Destroys \doxyref{QuaZip}{p.}{classQuaZip} object.
257
258Calls \doxyref{close()}{p.}{classQuaZip_a7a4323b73e12f3b4470109f200728f9f} if necessary.
259
260References close(), and isOpen().
261
262
263
264\subsection{Member Function Documentation}
265\index{QuaZip@{QuaZip}!convertCaseSensitivity@{convertCaseSensitivity}}
266\index{convertCaseSensitivity@{convertCaseSensitivity}!QuaZip@{QuaZip}}
267\subsubsection[{convertCaseSensitivity}]{\setlength{\rightskip}{0pt plus 5cm}Qt::CaseSensitivity QuaZip::convertCaseSensitivity (
268\begin{DoxyParamCaption}
269\item[{{\bf QuaZip::CaseSensitivity}}]{cs}
270\end{DoxyParamCaption}
271)\hspace{0.3cm}{\ttfamily [static]}}\label{classQuaZip_a1d3fbd445a8e9d3449ded7371931c6b3}
272
273
274Returns the actual case sensitivity for the specified QuaZIP one.
275
276
277\begin{DoxyParams}{Parameters}
278{\em cs} & The value to convert. \\
279\hline
280\end{DoxyParams}
281\begin{DoxyReturn}{Returns}
282If CaseSensitivity::csDefault, then returns the default file name case sensitivity for the platform. Otherwise, just returns the appropriate value from the Qt::CaseSensitivity enum.
283\end{DoxyReturn}
284
285
286References csDefault, and csSensitive.
287
288
289
290Referenced by QuaZipDir::exists(), and setCurrentFile().
291
292\index{QuaZip@{QuaZip}!open@{open}}
293\index{open@{open}!QuaZip@{QuaZip}}
294\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::open (
295\begin{DoxyParamCaption}
296\item[{{\bf Mode}}]{mode, }
297\item[{zlib\_\-filefunc\_\-def $\ast$}]{ioApi = {\ttfamily NULL}}
298\end{DoxyParamCaption}
299)}\label{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962}
300
301
302Opens ZIP file.
303
304Argument {\itshape mode\/} specifies open mode of the ZIP archive. See Mode for details. Note that there is zipOpen2() function in the ZIP/UNZIP API which accepts {\itshape globalcomment\/} argument, but it does not use it anywhere, so this \doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} function does not have this argument. See \doxyref{setComment()}{p.}{classQuaZip_a1b5d936a203859340574d5908ffa2222} if you need to set global comment.
305
306If the ZIP file is accessed via explicitly set {\bf QIODevice}, then this device is opened in the necessary mode. If the device was already opened by some other means, then QuaZIP checks if the open mode is compatible to the mode needed for the requested operation. If necessary, seeking is performed to position the device properly.
307
308\begin{DoxyReturn}{Returns}
309{\ttfamily true} if successful, {\ttfamily false} otherwise.
310\end{DoxyReturn}
311\begin{DoxyNote}{Note}
312ZIP/UNZIP API open calls do not return error code -\/ they just return {\ttfamily NULL} indicating an error. But to make things easier, \doxyref{quazip.h}{p.}{quazip_8h_source} header defines additional error code {\ttfamily UNZ\_\-ERROROPEN} and \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} will return it if the open call of the ZIP/UNZIP API returns {\ttfamily NULL}.
313\end{DoxyNote}
314Argument {\itshape ioApi\/} specifies IO function set for ZIP/UNZIP package to use. See unzip.h, zip.h and ioapi.h for details. Note that IO API for \doxyref{QuaZip}{p.}{classQuaZip} is different from the original package. The file path argument was changed to be of type {\ttfamily voidpf}, and \doxyref{QuaZip}{p.}{classQuaZip} passes a {\bf QIODevice} pointer there. This {\bf QIODevice} is either set explicitly via \doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6} or the \doxyref{QuaZip(QIODevice$\ast$)}{p.}{classQuaZip_ae52ebadd5ce64cdb49d7e198904b0b8c} constructor, or it is created internally when opening the archive by its file name. The default API (qioapi.cpp) just delegates everything to the {\bf QIODevice} API. Not only this allows to use a {\bf QIODevice} instead of file name, but also has a nice side effect of raising the file size limit from 2G to 4G (in non-\/zip64 archives).
315
316\begin{DoxyNote}{Note}
317If the zip64 support is needed, the ioApi argument {\itshape must\/} be NULL because due to the backwards compatibility issues it can be used to provide a 32-\/bit API only.
318
319If the \doxyref{no-\/auto-\/close}{p.}{classQuaZip_a54bfc924762774ccf9f99be075ba7b0e} feature is used, then the {\itshape ioApi\/} argument {\itshape should\/} be NULL because the old API doesn't support the 'fake close' operation, causing slight memory leaks and other possible troubles (like closing the output device in case when an error occurs during opening).
320\end{DoxyNote}
321In short: just forget about the {\itshape ioApi\/} argument and you'll be fine.
322
323References QString::isEmpty(), isOpen(), QIODevice::isSequential(), mdAdd, mdAppend, mdCreate, mdUnzip, QuaZipPrivate::unzFile\_\-f, and QuaZipPrivate::zipFile\_\-f.
324
325
326
327Referenced by JlCompress::compressDir(), JlCompress::compressFile(), JlCompress::compressFiles(), and QuaZipFile::open().
328
329\index{QuaZip@{QuaZip}!close@{close}}
330\index{close@{close}!QuaZip@{QuaZip}}
331\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::close (
332\begin{DoxyParamCaption}
333{}
334\end{DoxyParamCaption}
335)}\label{classQuaZip_a7a4323b73e12f3b4470109f200728f9f}
336
337
338Closes ZIP file.
339
340Call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} to determine if the close was successful.
341
342If the file was opened by name, then the underlying {\bf QIODevice} is closed and deleted.
343
344If the underlying {\bf QIODevice} was set explicitly using \doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6} or the appropriate constructor, then it is closed if the auto-\/close flag is set (which it is by default). Call \doxyref{setAutoClose()}{p.}{classQuaZip_a54bfc924762774ccf9f99be075ba7b0e} to clear the auto-\/close flag if this behavior is undesirable.
345
346Since {\bf Qt} 5.1, the {\bf QSaveFile} was introduced. It breaks the {\bf QIODevice} API by making \doxyref{close()}{p.}{classQuaZip_a7a4323b73e12f3b4470109f200728f9f} private and crashing the application if it is called from the base class where it is public. It is an excellent example of poor design that illustrates why you should never ever break an is-\/a relationship between the base class and a subclass. QuaZIP works around this bug by checking if the {\bf QIODevice} is an instance of {\bf QSaveFile}, using qobject\_\-cast$<$$>$, and if it is, calls {\bf QSaveFile::commit()} instead of \doxyref{close()}{p.}{classQuaZip_a7a4323b73e12f3b4470109f200728f9f}. It is a really ugly hack, but at least it makes your programs work instead of crashing. Note that if the auto-\/close flag is cleared, then this is a non-\/issue, and commit() isn't called.
347
348References QByteArray::constData(), QTextCodec::fromUnicode(), QString::isEmpty(), QString::isNull(), mdAdd, mdAppend, mdCreate, mdNotOpen, mdUnzip, QuaZipPrivate::unzFile\_\-f, and QuaZipPrivate::zipFile\_\-f.
349
350
351
352Referenced by QuaZipFile::close(), JlCompress::compressDir(), JlCompress::compressFile(), JlCompress::compressFiles(), QuaZipFile::open(), and $\sim$QuaZip().
353
354\index{QuaZip@{QuaZip}!setFileNameCodec@{setFileNameCodec}}
355\index{setFileNameCodec@{setFileNameCodec}!QuaZip@{QuaZip}}
356\subsubsection[{setFileNameCodec}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setFileNameCodec (
357\begin{DoxyParamCaption}
358\item[{{\bf QTextCodec} $\ast$}]{fileNameCodec}
359\end{DoxyParamCaption}
360)}\label{classQuaZip_a339010b5566704ba3c9cafbfe848d8fb}
361
362
363Sets the codec used to encode/decode file names inside archive.
364
365This is necessary to access files in the ZIP archive created under Windows with non-\/latin characters in file names. For example, file names with cyrillic letters will be in {\ttfamily IBM866} encoding. \index{QuaZip@{QuaZip}!setFileNameCodec@{setFileNameCodec}}
366\index{setFileNameCodec@{setFileNameCodec}!QuaZip@{QuaZip}}
367\subsubsection[{setFileNameCodec}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setFileNameCodec (
368\begin{DoxyParamCaption}
369\item[{const char $\ast$}]{fileNameCodecName}
370\end{DoxyParamCaption}
371)}\label{classQuaZip_a8f283519a195aa1d9076bbbb01ea0497}
372
373
374Sets the codec used to encode/decode file names inside archive.
375
376This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Equivalent to calling setFileNameCodec(QTextCodec::codecForName(codecName));
377
378References QTextCodec::codecForName().
379
380\index{QuaZip@{QuaZip}!setCommentCodec@{setCommentCodec}}
381\index{setCommentCodec@{setCommentCodec}!QuaZip@{QuaZip}}
382\subsubsection[{setCommentCodec}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setCommentCodec (
383\begin{DoxyParamCaption}
384\item[{{\bf QTextCodec} $\ast$}]{commentCodec}
385\end{DoxyParamCaption}
386)}\label{classQuaZip_a1c81fca7215a4374f6f03872ade4885b}
387
388
389Sets the codec used to encode/decode comments inside archive.
390
391This codec defaults to locale codec, which is probably ok. \index{QuaZip@{QuaZip}!setCommentCodec@{setCommentCodec}}
392\index{setCommentCodec@{setCommentCodec}!QuaZip@{QuaZip}}
393\subsubsection[{setCommentCodec}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setCommentCodec (
394\begin{DoxyParamCaption}
395\item[{const char $\ast$}]{commentCodecName}
396\end{DoxyParamCaption}
397)}\label{classQuaZip_a413f3c56b54a9a47258d53802cb606e7}
398
399
400Sets the codec used to encode/decode comments inside archive.
401
402This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Equivalent to calling setCommentCodec(QTextCodec::codecForName(codecName));
403
404References QTextCodec::codecForName().
405
406\index{QuaZip@{QuaZip}!getZipName@{getZipName}}
407\index{getZipName@{getZipName}!QuaZip@{QuaZip}}
408\subsubsection[{getZipName}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} QuaZip::getZipName (
409\begin{DoxyParamCaption}
410{}
411\end{DoxyParamCaption}
412) const}\label{classQuaZip_a4f7deef08ff40aeb1a7a04bcd7f228c2}
413
414
415Returns the name of the ZIP file.
416
417Returns null string if no ZIP file name has been set, for example when the \doxyref{QuaZip}{p.}{classQuaZip} instance is set up to use a {\bf QIODevice} instead. \begin{DoxySeeAlso}{See also}
418\doxyref{setZipName()}{p.}{classQuaZip_aa80b661de1262af905d1677dbcb008cc}, \doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6}, \doxyref{getIoDevice()}{p.}{classQuaZip_afd3ba12fe68748acbf8b7cc14a5a1c29}
419\end{DoxySeeAlso}
420
421
422Referenced by QuaZipFile::getZipName().
423
424\index{QuaZip@{QuaZip}!setZipName@{setZipName}}
425\index{setZipName@{setZipName}!QuaZip@{QuaZip}}
426\subsubsection[{setZipName}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setZipName (
427\begin{DoxyParamCaption}
428\item[{const {\bf QString} \&}]{zipName}
429\end{DoxyParamCaption}
430)}\label{classQuaZip_aa80b661de1262af905d1677dbcb008cc}
431
432
433Sets the name of the ZIP file.
434
435Does nothing if the ZIP file is open.
436
437Does not reset error code returned by \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4}. \begin{DoxySeeAlso}{See also}
438\doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6}, \doxyref{getIoDevice()}{p.}{classQuaZip_afd3ba12fe68748acbf8b7cc14a5a1c29}, \doxyref{getZipName()}{p.}{classQuaZip_a4f7deef08ff40aeb1a7a04bcd7f228c2}
439\end{DoxySeeAlso}
440
441
442References isOpen().
443
444\index{QuaZip@{QuaZip}!getIoDevice@{getIoDevice}}
445\index{getIoDevice@{getIoDevice}!QuaZip@{QuaZip}}
446\subsubsection[{getIoDevice}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QIODevice} $\ast$ QuaZip::getIoDevice (
447\begin{DoxyParamCaption}
448{}
449\end{DoxyParamCaption}
450) const}\label{classQuaZip_afd3ba12fe68748acbf8b7cc14a5a1c29}
451
452
453Returns the device representing this ZIP file.
454
455Returns null string if no device has been set explicitly, for example when opening a ZIP file by name. \begin{DoxySeeAlso}{See also}
456\doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6}, \doxyref{getZipName()}{p.}{classQuaZip_a4f7deef08ff40aeb1a7a04bcd7f228c2}, \doxyref{setZipName()}{p.}{classQuaZip_aa80b661de1262af905d1677dbcb008cc}
457\end{DoxySeeAlso}
458
459
460References QString::isEmpty().
461
462\index{QuaZip@{QuaZip}!setIoDevice@{setIoDevice}}
463\index{setIoDevice@{setIoDevice}!QuaZip@{QuaZip}}
464\subsubsection[{setIoDevice}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setIoDevice (
465\begin{DoxyParamCaption}
466\item[{{\bf QIODevice} $\ast$}]{ioDevice}
467\end{DoxyParamCaption}
468)}\label{classQuaZip_a64642948b6531ee54f5522f29e388cc6}
469
470
471Sets the device representing the ZIP file.
472
473Does nothing if the ZIP file is open.
474
475Does not reset error code returned by \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4}. \begin{DoxySeeAlso}{See also}
476\doxyref{getIoDevice()}{p.}{classQuaZip_afd3ba12fe68748acbf8b7cc14a5a1c29}, \doxyref{getZipName()}{p.}{classQuaZip_a4f7deef08ff40aeb1a7a04bcd7f228c2}, \doxyref{setZipName()}{p.}{classQuaZip_aa80b661de1262af905d1677dbcb008cc}
477\end{DoxySeeAlso}
478
479
480References isOpen().
481
482\index{QuaZip@{QuaZip}!getZipError@{getZipError}}
483\index{getZipError@{getZipError}!QuaZip@{QuaZip}}
484\subsubsection[{getZipError}]{\setlength{\rightskip}{0pt plus 5cm}int QuaZip::getZipError (
485\begin{DoxyParamCaption}
486{}
487\end{DoxyParamCaption}
488) const}\label{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4}
489
490
491Returns the error code of the last operation.
492
493Returns {\ttfamily UNZ\_\-OK} if the last operation was successful.
494
495Error code resets to {\ttfamily UNZ\_\-OK} every time you call any function that accesses something inside ZIP archive, even if it is {\ttfamily const} (like \doxyref{getEntriesCount()}{p.}{classQuaZip_a2ea4bd1fca948637c35c2d2752bb5a80}). \doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} and \doxyref{close()}{p.}{classQuaZip_a7a4323b73e12f3b4470109f200728f9f} calls reset error code too. See documentation for the specific functions for details on error detection.
496
497Referenced by QuaZipFile::close(), JlCompress::compressDir(), JlCompress::compressFile(), JlCompress::compressFiles(), QuaZipFile::getActualFileName(), QuaZipFile::getFileInfo(), and QuaZipFile::open().
498
499\index{QuaZip@{QuaZip}!getEntriesCount@{getEntriesCount}}
500\index{getEntriesCount@{getEntriesCount}!QuaZip@{QuaZip}}
501\subsubsection[{getEntriesCount}]{\setlength{\rightskip}{0pt plus 5cm}int QuaZip::getEntriesCount (
502\begin{DoxyParamCaption}
503{}
504\end{DoxyParamCaption}
505) const}\label{classQuaZip_a2ea4bd1fca948637c35c2d2752bb5a80}
506
507
508Returns number of the entries in the ZIP central directory.
509
510Returns negative error code in the case of error. The same error code will be returned by subsequent \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} call.
511
512References mdUnzip, and QuaZipPrivate::unzFile\_\-f.
513
514\index{QuaZip@{QuaZip}!setComment@{setComment}}
515\index{setComment@{setComment}!QuaZip@{QuaZip}}
516\subsubsection[{setComment}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setComment (
517\begin{DoxyParamCaption}
518\item[{const {\bf QString} \&}]{comment}
519\end{DoxyParamCaption}
520)}\label{classQuaZip_a1b5d936a203859340574d5908ffa2222}
521
522
523Sets the global comment in the ZIP file.
524
525The comment will be written to the archive on close operation. \doxyref{QuaZip}{p.}{classQuaZip} makes a distinction between a null QByteArray() comment and an empty "" comment in the \doxyref{QuaZip::mdAdd}{p.}{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a22c745f349f06add449af523254fdaec} mode. A null comment is the default and it means "don't change the comment". An empty comment removes the original comment.
526
527\begin{DoxySeeAlso}{See also}
528\doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962}
529\end{DoxySeeAlso}
530\index{QuaZip@{QuaZip}!goToFirstFile@{goToFirstFile}}
531\index{goToFirstFile@{goToFirstFile}!QuaZip@{QuaZip}}
532\subsubsection[{goToFirstFile}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::goToFirstFile (
533\begin{DoxyParamCaption}
534{}
535\end{DoxyParamCaption}
536)}\label{classQuaZip_a745488f9177bcec3cdb858587584e033}
537
538
539Sets the current file to the first file in the archive.
540
541Returns {\ttfamily true} on success, {\ttfamily false} otherwise. Call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} to get the error code.
542
543References mdUnzip, and QuaZipPrivate::unzFile\_\-f.
544
545\index{QuaZip@{QuaZip}!goToNextFile@{goToNextFile}}
546\index{goToNextFile@{goToNextFile}!QuaZip@{QuaZip}}
547\subsubsection[{goToNextFile}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::goToNextFile (
548\begin{DoxyParamCaption}
549{}
550\end{DoxyParamCaption}
551)}\label{classQuaZip_aee6779b6cd338420c2e8c5655fa8ba97}
552
553
554Sets the current file to the next file in the archive.
555
556Returns {\ttfamily true} on success, {\ttfamily false} otherwise. Call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} to determine if there was an error.
557
558Should be used only in \doxyref{QuaZip::mdUnzip}{p.}{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a803a371910c2dc830d111e9ce5b58897} mode.
559
560\begin{DoxyNote}{Note}
561If the end of file was reached, \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} will return {\ttfamily UNZ\_\-OK} instead of {\ttfamily UNZ\_\-END\_\-OF\_\-LIST\_\-OF\_\-FILE}. This is to make things like this easier:
562\begin{DoxyCode}
563 for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) {
564 // do something
565 }
566 if(zip.getZipError()==UNZ_OK) {
567 // ok, there was no error
568 }
569\end{DoxyCode}
570
571\end{DoxyNote}
572
573
574References mdUnzip, and QuaZipPrivate::unzFile\_\-f.
575
576
577
578Referenced by setCurrentFile().
579
580\index{QuaZip@{QuaZip}!setCurrentFile@{setCurrentFile}}
581\index{setCurrentFile@{setCurrentFile}!QuaZip@{QuaZip}}
582\subsubsection[{setCurrentFile}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::setCurrentFile (
583\begin{DoxyParamCaption}
584\item[{const {\bf QString} \&}]{fileName, }
585\item[{{\bf CaseSensitivity}}]{cs = {\ttfamily csDefault}}
586\end{DoxyParamCaption}
587)}\label{classQuaZip_a6c657bfcfccb59d728e0da24c677d899}
588
589
590Sets current file by its name.
591
592Returns {\ttfamily true} if successful, {\ttfamily false} otherwise. Argument {\itshape cs\/} specifies case sensitivity of the file name. Call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} in the case of a failure to get error code.
593
594This is not a wrapper to unzLocateFile() function. That is because I had to implement locale-\/specific case-\/insensitive comparison.
595
596Here are the differences from the original implementation:
597
598
599\begin{DoxyItemize}
600\item If the file was not found, error code is {\ttfamily UNZ\_\-OK}, not {\ttfamily UNZ\_\-END\_\-OF\_\-LIST\_\-OF\_\-FILE} (see also \doxyref{goToNextFile()}{p.}{classQuaZip_aee6779b6cd338420c2e8c5655fa8ba97}).
601\item If this function fails, it unsets the current file rather than resetting it back to what it was before the call.
602\end{DoxyItemize}
603
604If {\itshape fileName\/} is null string then this function unsets the current file and return {\ttfamily true}. Note that you should close the file first if it is open! See \doxyref{QuaZipFile::QuaZipFile(QuaZip$\ast$,QObject$\ast$)}{p.}{classQuaZipFile_a54e944a6b3d27030f64c8f30d2cc33bb} for the details.
605
606Should be used only in \doxyref{QuaZip::mdUnzip}{p.}{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a803a371910c2dc830d111e9ce5b58897} mode.
607
608\begin{DoxySeeAlso}{See also}
609\doxyref{setFileNameCodec()}{p.}{classQuaZip_a339010b5566704ba3c9cafbfe848d8fb}, \doxyref{CaseSensitivity}{p.}{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbe}
610\end{DoxySeeAlso}
611
612
613References QHash::contains(), convertCaseSensitivity(), getCurrentFileName(), goToNextFile(), QString::isEmpty(), QString::length(), MAX\_\-FILE\_\-NAME\_\-LENGTH, mdUnzip, QString::toLower(), QuaZipPrivate::unzFile\_\-f, and QHash::value().
614
615
616
617Referenced by QuaZipFile::open().
618
619\index{QuaZip@{QuaZip}!getCurrentFileInfo@{getCurrentFileInfo}}
620\index{getCurrentFileInfo@{getCurrentFileInfo}!QuaZip@{QuaZip}}
621\subsubsection[{getCurrentFileInfo}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::getCurrentFileInfo (
622\begin{DoxyParamCaption}
623\item[{{\bf QuaZipFileInfo} $\ast$}]{info}
624\end{DoxyParamCaption}
625) const}\label{classQuaZip_a9c91a53ed4c2038e153c64bdc097ebe8}
626
627
628Retrieves information about the current file.
629
630Fills the structure pointed by {\itshape info\/}. Returns {\ttfamily true} on success, {\ttfamily false} otherwise. In the latter case structure pointed by {\itshape info\/} remains untouched. If there was an error, \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} returns error code.
631
632Should be used only in \doxyref{QuaZip::mdUnzip}{p.}{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a803a371910c2dc830d111e9ce5b58897} mode.
633
634Does nothing and returns {\ttfamily false} in any of the following cases.
635\begin{DoxyItemize}
636\item ZIP is not open;
637\item ZIP does not have current file.
638\end{DoxyItemize}
639
640In both cases \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} returns {\ttfamily UNZ\_\-OK} since there is no ZIP/UNZIP API call.
641
642This overload doesn't support zip64, but will work OK on zip64 archives except that if one of the sizes (compressed or uncompressed) is greater than 0xFFFFFFFFu, it will be set to exactly 0xFFFFFFFFu.
643
644\begin{DoxySeeAlso}{See also}
645\doxyref{getCurrentFileInfo(QuaZipFileInfo64$\ast$ info)const}{p.}{classQuaZip_a7ba6daf39263c308c683e7f72f74e0ae}
646
647\doxyref{QuaZipFileInfo64::toQuaZipFileInfo(QuaZipFileInfo\&)const}{p.}{structQuaZipFileInfo64_ada29945c7ee4c9df6fbe95864793aade}
648\end{DoxySeeAlso}
649
650
651References QuaZipFileInfo64::toQuaZipFileInfo().
652
653
654
655Referenced by QuaZipFile::getFileInfo().
656
657\index{QuaZip@{QuaZip}!getCurrentFileInfo@{getCurrentFileInfo}}
658\index{getCurrentFileInfo@{getCurrentFileInfo}!QuaZip@{QuaZip}}
659\subsubsection[{getCurrentFileInfo}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::getCurrentFileInfo (
660\begin{DoxyParamCaption}
661\item[{{\bf QuaZipFileInfo64} $\ast$}]{info}
662\end{DoxyParamCaption}
663) const}\label{classQuaZip_a7ba6daf39263c308c683e7f72f74e0ae}
664
665
666Retrieves information about the current file.
667
668This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function supports zip64. If the archive doesn't use zip64, it is completely equivalent to getCurrentFileInfo(QuaZipFileInfo$\ast$ info) except for the argument type.
669
670\begin{DoxySeeAlso}{See also}
671
672\end{DoxySeeAlso}
673
674
675References QuaZipFileInfo64::comment, QuaZipFileInfo64::compressedSize, QuaZipFileInfo64::crc, QByteArray::data(), QuaZipFileInfo64::dateTime, QuaZipFileInfo64::diskNumberStart, QuaZipFileInfo64::externalAttr, QuaZipFileInfo64::extra, QuaZipFileInfo64::flags, hasCurrentFile(), QuaZipFileInfo64::internalAttr, isOpen(), mdUnzip, QuaZipFileInfo64::method, QuaZipFileInfo64::name, QByteArray::resize(), QByteArray::size(), QTextCodec::toUnicode(), QuaZipFileInfo64::uncompressedSize, QuaZipPrivate::unzFile\_\-f, QuaZipFileInfo64::versionCreated, and QuaZipFileInfo64::versionNeeded.
676
677\index{QuaZip@{QuaZip}!getCurrentFileName@{getCurrentFileName}}
678\index{getCurrentFileName@{getCurrentFileName}!QuaZip@{QuaZip}}
679\subsubsection[{getCurrentFileName}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} QuaZip::getCurrentFileName (
680\begin{DoxyParamCaption}
681{}
682\end{DoxyParamCaption}
683) const}\label{classQuaZip_a9783f8b4f39cd55e71e975aea78fd54a}
684
685
686Returns the current file name.
687
688Equivalent to calling \doxyref{getCurrentFileInfo()}{p.}{classQuaZip_a9c91a53ed4c2038e153c64bdc097ebe8} and then getting {\ttfamily name} field of the \doxyref{QuaZipFileInfo}{p.}{structQuaZipFileInfo} structure, but faster and more convenient.
689
690Should be used only in \doxyref{QuaZip::mdUnzip}{p.}{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a803a371910c2dc830d111e9ce5b58897} mode.
691
692References QByteArray::constData(), QByteArray::data(), hasCurrentFile(), QString::isEmpty(), isOpen(), MAX\_\-FILE\_\-NAME\_\-LENGTH, mdUnzip, QByteArray::size(), QTextCodec::toUnicode(), and QuaZipPrivate::unzFile\_\-f.
693
694
695
696Referenced by QuaZipFile::getActualFileName(), and setCurrentFile().
697
698\index{QuaZip@{QuaZip}!getUnzFile@{getUnzFile}}
699\index{getUnzFile@{getUnzFile}!QuaZip@{QuaZip}}
700\subsubsection[{getUnzFile}]{\setlength{\rightskip}{0pt plus 5cm}unzFile QuaZip::getUnzFile (
701\begin{DoxyParamCaption}
702{}
703\end{DoxyParamCaption}
704)}\label{classQuaZip_a3b78a652f296ff4a678a791e8294e642}
705
706
707Returns {\ttfamily unzFile} handle.
708
709You can use this handle to directly call UNZIP part of the ZIP/UNZIP package functions (see unzip.h).
710
711\begin{DoxyWarning}{Warning}
712When using the handle returned by this function, please keep in mind that \doxyref{QuaZip}{p.}{classQuaZip} class is unable to detect any changes you make in the ZIP file state (e. g. changing current file, or closing the handle). So please do not do anything with this handle that is possible to do with the functions of this class. Or at least return the handle in the original state before calling some another function of this class (including implicit destructor calls and calls from the \doxyref{QuaZipFile}{p.}{classQuaZipFile} objects that refer to this \doxyref{QuaZip}{p.}{classQuaZip} instance!). So if you have changed the current file in the ZIP archive -\/ then change it back or you may experience some strange behavior or even crashes.
713\end{DoxyWarning}
714
715
716References QuaZipPrivate::unzFile\_\-f.
717
718
719
720Referenced by QuaZipFile::atEnd(), QuaZipFile::close(), QuaZipFile::csize(), QuaZipFile::open(), QuaZipFile::pos(), QuaZipFile::readData(), and QuaZipFile::usize().
721
722\index{QuaZip@{QuaZip}!getZipFile@{getZipFile}}
723\index{getZipFile@{getZipFile}!QuaZip@{QuaZip}}
724\subsubsection[{getZipFile}]{\setlength{\rightskip}{0pt plus 5cm}zipFile QuaZip::getZipFile (
725\begin{DoxyParamCaption}
726{}
727\end{DoxyParamCaption}
728)}\label{classQuaZip_a425043a4d7cc31e2fe2bba73d954f15c}
729
730
731Returns {\ttfamily zipFile} handle.
732
733You can use this handle to directly call ZIP part of the ZIP/UNZIP package functions (see zip.h). Warnings about the \doxyref{getUnzFile()}{p.}{classQuaZip_a3b78a652f296ff4a678a791e8294e642} function also apply to this function.
734
735References QuaZipPrivate::zipFile\_\-f.
736
737
738
739Referenced by QuaZipFile::close(), QuaZipFile::open(), and QuaZipFile::writeData().
740
741\index{QuaZip@{QuaZip}!setDataDescriptorWritingEnabled@{setDataDescriptorWritingEnabled}}
742\index{setDataDescriptorWritingEnabled@{setDataDescriptorWritingEnabled}!QuaZip@{QuaZip}}
743\subsubsection[{setDataDescriptorWritingEnabled}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setDataDescriptorWritingEnabled (
744\begin{DoxyParamCaption}
745\item[{bool}]{enabled}
746\end{DoxyParamCaption}
747)}\label{classQuaZip_a6c23a12af88f7ea5edd4f9c0a24b9453}
748
749
750Changes the data descriptor writing mode.
751
752According to the ZIP format specification, a file inside archive may have a data descriptor immediately following the file data. This is reflected by a special flag in the local file header and in the central directory. By default, QuaZIP sets this flag and writes the data descriptor unless both method and level were set to 0, in which case it operates in 1.0-\/compatible mode and never writes data descriptors.
753
754By setting this flag to false, it is possible to disable data descriptor writing, thus increasing compatibility with archive readers that don't understand this feature of the ZIP file format.
755
756Setting this flag affects all the \doxyref{QuaZipFile}{p.}{classQuaZipFile} instances that are opened after this flag is set.
757
758The data descriptor writing mode is enabled by default.
759
760Note that if the ZIP archive is written into a {\bf QIODevice} for which {\bf QIODevice::isSequential()} returns {\ttfamily true}, then the data descriptor is mandatory and will be written even if this flag is set to false.
761
762
763\begin{DoxyParams}{Parameters}
764{\em enabled} & If {\ttfamily true}, enable local descriptor writing, disable it otherwise.\\
765\hline
766\end{DoxyParams}
767\begin{DoxySeeAlso}{See also}
768QuaZipFile::isDataDescriptorWritingEnabled()
769\end{DoxySeeAlso}
770\index{QuaZip@{QuaZip}!isDataDescriptorWritingEnabled@{isDataDescriptorWritingEnabled}}
771\index{isDataDescriptorWritingEnabled@{isDataDescriptorWritingEnabled}!QuaZip@{QuaZip}}
772\subsubsection[{isDataDescriptorWritingEnabled}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::isDataDescriptorWritingEnabled (
773\begin{DoxyParamCaption}
774{}
775\end{DoxyParamCaption}
776) const}\label{classQuaZip_ae5c665a59447c2d30e63e9c6df48ebb7}
777
778
779Returns the data descriptor default writing mode.
780
781\begin{DoxySeeAlso}{See also}
782\doxyref{setDataDescriptorWritingEnabled()}{p.}{classQuaZip_a6c23a12af88f7ea5edd4f9c0a24b9453}
783\end{DoxySeeAlso}
784
785
786Referenced by QuaZipFile::open().
787
788\index{QuaZip@{QuaZip}!getFileNameList@{getFileNameList}}
789\index{getFileNameList@{getFileNameList}!QuaZip@{QuaZip}}
790\subsubsection[{getFileNameList}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QStringList} QuaZip::getFileNameList (
791\begin{DoxyParamCaption}
792{}
793\end{DoxyParamCaption}
794) const}\label{classQuaZip_abb38d8b4c9c4ae0728b48caae9dd82de}
795
796
797Returns a list of files inside the archive.
798
799\begin{DoxyReturn}{Returns}
800A list of file names or an empty list if there was an error or if the archive is empty (call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} to figure out which).
801\end{DoxyReturn}
802\begin{DoxySeeAlso}{See also}
803\doxyref{getFileInfoList()}{p.}{classQuaZip_a7486af66bede8e131db0cd2e81881387}
804\end{DoxySeeAlso}
805\index{QuaZip@{QuaZip}!getFileInfoList@{getFileInfoList}}
806\index{getFileInfoList@{getFileInfoList}!QuaZip@{QuaZip}}
807\subsubsection[{getFileInfoList}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QList}$<$ {\bf QuaZipFileInfo} $>$ QuaZip::getFileInfoList (
808\begin{DoxyParamCaption}
809{}
810\end{DoxyParamCaption}
811) const}\label{classQuaZip_a7486af66bede8e131db0cd2e81881387}
812
813
814Returns information list about all files inside the archive.
815
816\begin{DoxyReturn}{Returns}
817A list of \doxyref{QuaZipFileInfo}{p.}{structQuaZipFileInfo} objects or an empty list if there was an error or if the archive is empty (call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} to figure out which).
818\end{DoxyReturn}
819This function doesn't support zip64, but will still work with zip64 archives, converting results using \doxyref{QuaZipFileInfo64::toQuaZipFileInfo()}{p.}{structQuaZipFileInfo64_ada29945c7ee4c9df6fbe95864793aade}. If all file sizes are below 4 GB, it will work just fine.
820
821\begin{DoxySeeAlso}{See also}
822\doxyref{getFileNameList()}{p.}{classQuaZip_abb38d8b4c9c4ae0728b48caae9dd82de}
823
824\doxyref{getFileInfoList64()}{p.}{classQuaZip_a474e66b1b696a9e00edcc067484c36ad}
825\end{DoxySeeAlso}
826\index{QuaZip@{QuaZip}!getFileInfoList64@{getFileInfoList64}}
827\index{getFileInfoList64@{getFileInfoList64}!QuaZip@{QuaZip}}
828\subsubsection[{getFileInfoList64}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QList}$<$ {\bf QuaZipFileInfo64} $>$ QuaZip::getFileInfoList64 (
829\begin{DoxyParamCaption}
830{}
831\end{DoxyParamCaption}
832) const}\label{classQuaZip_a474e66b1b696a9e00edcc067484c36ad}
833
834
835Returns information list about all files inside the archive.
836
837This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function supports zip64.
838
839\begin{DoxySeeAlso}{See also}
840\doxyref{getFileNameList()}{p.}{classQuaZip_abb38d8b4c9c4ae0728b48caae9dd82de}
841
842\doxyref{getFileInfoList()}{p.}{classQuaZip_a7486af66bede8e131db0cd2e81881387}
843\end{DoxySeeAlso}
844\index{QuaZip@{QuaZip}!setZip64Enabled@{setZip64Enabled}}
845\index{setZip64Enabled@{setZip64Enabled}!QuaZip@{QuaZip}}
846\subsubsection[{setZip64Enabled}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setZip64Enabled (
847\begin{DoxyParamCaption}
848\item[{bool}]{zip64}
849\end{DoxyParamCaption}
850)}\label{classQuaZip_ab99a22efae02ebb4b5c9cd8eedc1c0b0}
851
852
853Enables the zip64 mode.
854
855
856\begin{DoxyParams}{Parameters}
857{\em zip64} & If {\ttfamily true}, the zip64 mode is enabled, disabled otherwise.\\
858\hline
859\end{DoxyParams}
860Once this is enabled, all new files (until the mode is disabled again) will be created in the zip64 mode, thus enabling the ability to write files larger than 4 GB. By default, the zip64 mode is off due to compatibility reasons.
861
862Note that this does not affect the ability to read zip64 archives in any way.
863
864\begin{DoxySeeAlso}{See also}
865\doxyref{isZip64Enabled()}{p.}{classQuaZip_a1b638566390d7599ba5982e844b151f4}
866\end{DoxySeeAlso}
867\index{QuaZip@{QuaZip}!isZip64Enabled@{isZip64Enabled}}
868\index{isZip64Enabled@{isZip64Enabled}!QuaZip@{QuaZip}}
869\subsubsection[{isZip64Enabled}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::isZip64Enabled (
870\begin{DoxyParamCaption}
871{}
872\end{DoxyParamCaption}
873) const}\label{classQuaZip_a1b638566390d7599ba5982e844b151f4}
874
875
876Returns whether the zip64 mode is enabled.
877
878\begin{DoxyReturn}{Returns}
879{\ttfamily true} if and only if the zip64 mode is enabled.
880\end{DoxyReturn}
881\begin{DoxySeeAlso}{See also}
882\doxyref{setZip64Enabled()}{p.}{classQuaZip_ab99a22efae02ebb4b5c9cd8eedc1c0b0}
883\end{DoxySeeAlso}
884
885
886Referenced by QuaZipFile::open().
887
888\index{QuaZip@{QuaZip}!isAutoClose@{isAutoClose}}
889\index{isAutoClose@{isAutoClose}!QuaZip@{QuaZip}}
890\subsubsection[{isAutoClose}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::isAutoClose (
891\begin{DoxyParamCaption}
892{}
893\end{DoxyParamCaption}
894) const}\label{classQuaZip_adc2cc762ab5744720ae4d33290b5f5bf}
895
896
897Returns the auto-\/close flag.
898
899\begin{DoxySeeAlso}{See also}
900\doxyref{setAutoClose()}{p.}{classQuaZip_a54bfc924762774ccf9f99be075ba7b0e}
901\end{DoxySeeAlso}
902\index{QuaZip@{QuaZip}!setAutoClose@{setAutoClose}}
903\index{setAutoClose@{setAutoClose}!QuaZip@{QuaZip}}
904\subsubsection[{setAutoClose}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setAutoClose (
905\begin{DoxyParamCaption}
906\item[{bool}]{autoClose}
907\end{DoxyParamCaption}
908) const}\label{classQuaZip_a54bfc924762774ccf9f99be075ba7b0e}
909
910
911Sets or unsets the auto-\/close flag.
912
913By default, QuaZIP opens the underlying {\bf QIODevice} when \doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} is called, and closes it when \doxyref{close()}{p.}{classQuaZip_a7a4323b73e12f3b4470109f200728f9f} is called. In some cases, when the device is set explicitly using \doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6}, it may be desirable to leave the device open. If the auto-\/close flag is unset using this method, then the device isn't closed automatically if it was set explicitly.
914
915If it is needed to clear this flag, it is recommended to do so before opening the archive because otherwise QuaZIP may close the device during the \doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} call if an error is encountered after the device is opened.
916
917If the device was not set explicitly, but rather the \doxyref{setZipName()}{p.}{classQuaZip_aa80b661de1262af905d1677dbcb008cc} or the appropriate constructor was used to set the ZIP file name instead, then the auto-\/close flag has no effect, and the internal device is closed nevertheless because there is no other way to close it.
918
919\begin{DoxySeeAlso}{See also}
920\doxyref{isAutoClose()}{p.}{classQuaZip_adc2cc762ab5744720ae4d33290b5f5bf}
921
922\doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6}
923\end{DoxySeeAlso}
924\index{QuaZip@{QuaZip}!setDefaultFileNameCodec@{setDefaultFileNameCodec}}
925\index{setDefaultFileNameCodec@{setDefaultFileNameCodec}!QuaZip@{QuaZip}}
926\subsubsection[{setDefaultFileNameCodec}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setDefaultFileNameCodec (
927\begin{DoxyParamCaption}
928\item[{{\bf QTextCodec} $\ast$}]{codec}
929\end{DoxyParamCaption}
930)\hspace{0.3cm}{\ttfamily [static]}}\label{classQuaZip_a317f5db89d84a80417338a3ab89770da}
931
932
933Sets the default file name codec to use.
934
935The default codec is used by the constructors, so calling this function won't affect the \doxyref{QuaZip}{p.}{classQuaZip} instances already created at that moment.
936
937The codec specified here can be overriden by calling \doxyref{setFileNameCodec()}{p.}{classQuaZip_a339010b5566704ba3c9cafbfe848d8fb}. If neither function is called, {\bf QTextCodec::codecForLocale()} will be used to decode or encode file names. Use this function with caution if the application uses other libraries that depend on QuaZIP. Those libraries can either call this function by themselves, thus overriding your setting or can rely on the default encoding, thus failing mysteriously if you change it. For these reasons, it isn't recommended to use this function if you are developing a library, not an application. Instead, ask your library users to call it in case they need specific encoding.
938
939In most cases, using \doxyref{setFileNameCodec()}{p.}{classQuaZip_a339010b5566704ba3c9cafbfe848d8fb} instead is the right choice. However, if you depend on third-\/party code that uses QuaZIP, then the reasons stated above can actually become a reason to use this function in case the third-\/party code in question fails because it doesn't understand the encoding you need and doesn't provide a way to specify it. This applies to the \doxyref{JlCompress}{p.}{classJlCompress} class as well, as it was contributed and doesn't support explicit encoding parameters.
940
941In short: use \doxyref{setFileNameCodec()}{p.}{classQuaZip_a339010b5566704ba3c9cafbfe848d8fb} when you can, resort to \doxyref{setDefaultFileNameCodec()}{p.}{classQuaZip_a317f5db89d84a80417338a3ab89770da} when you don't have access to the \doxyref{QuaZip}{p.}{classQuaZip} instance.
942
943
944\begin{DoxyParams}{Parameters}
945{\em codec} & The codec to use by default. If NULL, resets to default. \\
946\hline
947\end{DoxyParams}
948
949
950Referenced by setDefaultFileNameCodec().
951
952\index{QuaZip@{QuaZip}!setDefaultFileNameCodec@{setDefaultFileNameCodec}}
953\index{setDefaultFileNameCodec@{setDefaultFileNameCodec}!QuaZip@{QuaZip}}
954\subsubsection[{setDefaultFileNameCodec}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setDefaultFileNameCodec (
955\begin{DoxyParamCaption}
956\item[{const char $\ast$}]{codecName}
957\end{DoxyParamCaption}
958)\hspace{0.3cm}{\ttfamily [static]}}\label{classQuaZip_a694af3c0ab076fab7bf619952f6fbfea}
959This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Equivalent to calling setDefltFileNameCodec(QTextCodec::codecForName(codecName)).
960
961References QTextCodec::codecForName(), and setDefaultFileNameCodec().
962
963
964
965The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
966\item
967quazip/quazip.h\item
968quazip/quazip.cpp\end{DoxyCompactItemize}
Note: See TracBrowser for help on using the repository browser.