source: Vago/quazip-0.7.2/doc/latex/structQuaZipNewInfo.tex@ 1052

Last change on this file since 1052 was 1049, checked in by s10k, 8 years ago
File size: 17.4 KB
RevLine 
[1049]1\section{QuaZipNewInfo Struct Reference}
2\label{structQuaZipNewInfo}\index{QuaZipNewInfo@{QuaZipNewInfo}}
3
4
5Information about a file to be created.
6
7
8
9
10{\ttfamily \#include $<$quazipnewinfo.h$>$}
11
12
13
14Collaboration diagram for QuaZipNewInfo:
15\nopagebreak
16\begin{figure}[H]
17\begin{center}
18\leavevmode
19\includegraphics[width=264pt]{structQuaZipNewInfo__coll__graph}
20\end{center}
21\end{figure}
22\subsection*{Public Member Functions}
23\begin{DoxyCompactItemize}
24\item
25{\bf QuaZipNewInfo} (const {\bf QString} \&{\bf name})
26\begin{DoxyCompactList}\small\item\em Constructs \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo} instance. \end{DoxyCompactList}\item
27{\bf QuaZipNewInfo} (const {\bf QString} \&{\bf name}, const {\bf QString} \&file)
28\begin{DoxyCompactList}\small\item\em Constructs \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo} instance. \end{DoxyCompactList}\item
29{\bf QuaZipNewInfo} (const {\bf QuaZipFileInfo} \&existing)
30\begin{DoxyCompactList}\small\item\em Initializes the new instance from existing file info. \end{DoxyCompactList}\item
31{\bf QuaZipNewInfo} (const {\bf QuaZipFileInfo64} \&existing)
32\begin{DoxyCompactList}\small\item\em Initializes the new instance from existing file info. \end{DoxyCompactList}\item
33void {\bf setFileDateTime} (const {\bf QString} \&file)
34\begin{DoxyCompactList}\small\item\em Sets the file timestamp from the existing file. \end{DoxyCompactList}\item
35void {\bf setFilePermissions} (const {\bf QString} \&file)
36\begin{DoxyCompactList}\small\item\em Sets the file permissions from the existing file. \end{DoxyCompactList}\item
37void {\bf setPermissions} ({\bf QFile::Permissions} permissions)
38\begin{DoxyCompactList}\small\item\em Sets the file permissions. \end{DoxyCompactList}\item
39void {\bf setFileNTFSTimes} (const {\bf QString} \&fileName)
40\begin{DoxyCompactList}\small\item\em Sets the NTFS times from an existing file. \end{DoxyCompactList}\item
41void {\bf setFileNTFSmTime} (const {\bf QDateTime} \&mTime, int fineTicks=0)
42\begin{DoxyCompactList}\small\item\em Sets the NTFS modification time. \end{DoxyCompactList}\item
43void {\bf setFileNTFSaTime} (const {\bf QDateTime} \&aTime, int fineTicks=0)
44\begin{DoxyCompactList}\small\item\em Sets the NTFS access time. \end{DoxyCompactList}\item
45void {\bf setFileNTFScTime} (const {\bf QDateTime} \&cTime, int fineTicks=0)
46\begin{DoxyCompactList}\small\item\em Sets the NTFS creation time. \end{DoxyCompactList}\end{DoxyCompactItemize}
47\subsection*{Public Attributes}
48\begin{DoxyCompactItemize}
49\item
50{\bf QString} {\bf name}
51\begin{DoxyCompactList}\small\item\em File name. \end{DoxyCompactList}\item
52{\bf QDateTime} {\bf dateTime}
53\begin{DoxyCompactList}\small\item\em File timestamp. \end{DoxyCompactList}\item
54quint16 {\bf internalAttr}\label{structQuaZipNewInfo_a59ce9776c2ac7547ade8cb4c404c77ab}
55
56\begin{DoxyCompactList}\small\item\em File internal attributes. \end{DoxyCompactList}\item
57quint32 {\bf externalAttr}
58\begin{DoxyCompactList}\small\item\em File external attributes. \end{DoxyCompactList}\item
59{\bf QString} {\bf comment}
60\begin{DoxyCompactList}\small\item\em File comment. \end{DoxyCompactList}\item
61{\bf QByteArray} {\bf extraLocal}\label{structQuaZipNewInfo_ab377a81c51cf495c7aeee4f19340a43f}
62
63\begin{DoxyCompactList}\small\item\em File local extra field. \end{DoxyCompactList}\item
64{\bf QByteArray} {\bf extraGlobal}\label{structQuaZipNewInfo_abda207eb3949db3a88761c1b06e6bd58}
65
66\begin{DoxyCompactList}\small\item\em File global extra field. \end{DoxyCompactList}\item
67ulong {\bf uncompressedSize}
68\begin{DoxyCompactList}\small\item\em Uncompressed file size. \end{DoxyCompactList}\end{DoxyCompactItemize}
69
70
71\subsection{Detailed Description}
72Information about a file to be created.
73
74This structure holds information about a file to be created inside ZIP archive. At least name should be set to something correct before passing this structure to QuaZipFile::open(OpenMode,const QuaZipNewInfo\&,int,int,bool).
75
76Zip64 support of this structure is slightly limited: in the raw mode (when a pre-\/compressed file is written into a ZIP file as-\/is), it is necessary to specify the uncompressed file size and the appropriate field is 32 bit. Since the raw mode is used extremely rare, there is no real need to have a separate QuaZipNewInfo64 structure like \doxyref{QuaZipFileInfo64}{p.}{structQuaZipFileInfo64}. It may be added in the future though, if there is a demand for the raw mode with zip64 archives.
77
78\subsection{Constructor \& Destructor Documentation}
79\index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}}
80\index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}}
81\subsubsection[{QuaZipNewInfo}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipNewInfo::QuaZipNewInfo (
82\begin{DoxyParamCaption}
83\item[{const {\bf QString} \&}]{name}
84\end{DoxyParamCaption}
85)}\label{structQuaZipNewInfo_a46c0f551cf9e6b2131929beb39187aac}
86
87
88Constructs \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo} instance.
89
90Initializes name with {\itshape name\/}, dateTime with current date and time. Attributes are initialized with zeros, comment and extra field with null values. \index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}}
91\index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}}
92\subsubsection[{QuaZipNewInfo}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipNewInfo::QuaZipNewInfo (
93\begin{DoxyParamCaption}
94\item[{const {\bf QString} \&}]{name, }
95\item[{const {\bf QString} \&}]{file}
96\end{DoxyParamCaption}
97)}\label{structQuaZipNewInfo_ad47cf11f4277edcb09a8ba2b2963f2a9}
98
99
100Constructs \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo} instance.
101
102Initializes name with {\itshape name\/}. Timestamp and permissions are taken from the specified file. If the {\itshape file\/} does not exists or its timestamp is inaccessible (e. g. you do not have read permission for the directory file in), uses current time and zero permissions. Other attributes are initialized with zeros, comment and extra field with null values.
103
104\begin{DoxySeeAlso}{See also}
105\doxyref{setFileDateTime()}{p.}{structQuaZipNewInfo_a2b18b554d056877a2f33ffb9d241ed85}
106\end{DoxySeeAlso}
107
108
109References QDateTime::currentDateTime(), dateTime, QFileInfo::exists(), QFileInfo::isDir(), QFileInfo::lastModified(), and QFileInfo::permissions().
110
111\index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}}
112\index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}}
113\subsubsection[{QuaZipNewInfo}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipNewInfo::QuaZipNewInfo (
114\begin{DoxyParamCaption}
115\item[{const {\bf QuaZipFileInfo} \&}]{existing}
116\end{DoxyParamCaption}
117)}\label{structQuaZipNewInfo_a5f1a867f3b0d29d076f9014f70b59e5a}
118
119
120Initializes the new instance from existing file info.
121
122Mainly used when copying files between archives.
123
124Both extra fields are initialized to existing.extra. \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo}
125\begin{DoxyParams}{Parameters}
126{\em existing} & \\
127\hline
128\end{DoxyParams}
129\index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}}
130\index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}}
131\subsubsection[{QuaZipNewInfo}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipNewInfo::QuaZipNewInfo (
132\begin{DoxyParamCaption}
133\item[{const {\bf QuaZipFileInfo64} \&}]{existing}
134\end{DoxyParamCaption}
135)}\label{structQuaZipNewInfo_a4afa2e8c282a801fc216f79026c2d062}
136
137
138Initializes the new instance from existing file info.
139
140Mainly used when copying files between archives.
141
142Both extra fields are initialized to existing.extra. \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo}
143\begin{DoxyParams}{Parameters}
144{\em existing} & \\
145\hline
146\end{DoxyParams}
147
148
149\subsection{Member Function Documentation}
150\index{QuaZipNewInfo@{QuaZipNewInfo}!setFileDateTime@{setFileDateTime}}
151\index{setFileDateTime@{setFileDateTime}!QuaZipNewInfo@{QuaZipNewInfo}}
152\subsubsection[{setFileDateTime}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipNewInfo::setFileDateTime (
153\begin{DoxyParamCaption}
154\item[{const {\bf QString} \&}]{file}
155\end{DoxyParamCaption}
156)}\label{structQuaZipNewInfo_a2b18b554d056877a2f33ffb9d241ed85}
157
158
159Sets the file timestamp from the existing file.
160
161Use this function to set the file timestamp from the existing file. Use it like this:
162\begin{DoxyCode}
163 QuaZipFile zipFile(&zip);
164 QFile file("file-to-add");
165 file.open(QIODevice::ReadOnly);
166 QuaZipNewInfo info("file-name-in-archive");
167 info.setFileDateTime("file-to-add"); // take the timestamp from file
168 zipFile.open(QIODevice::WriteOnly, info);
169\end{DoxyCode}
170
171
172This function does not change dateTime if some error occured (e. g. file is inaccessible).
173
174References dateTime, QFileInfo::exists(), and QFileInfo::lastModified().
175
176\index{QuaZipNewInfo@{QuaZipNewInfo}!setFilePermissions@{setFilePermissions}}
177\index{setFilePermissions@{setFilePermissions}!QuaZipNewInfo@{QuaZipNewInfo}}
178\subsubsection[{setFilePermissions}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipNewInfo::setFilePermissions (
179\begin{DoxyParamCaption}
180\item[{const {\bf QString} \&}]{file}
181\end{DoxyParamCaption}
182)}\label{structQuaZipNewInfo_a08bee5211eb0b49da260c7a9e7a266b8}
183
184
185Sets the file permissions from the existing file.
186
187Takes permissions from the file and sets the high 16 bits of external attributes. Uses {\bf QFileInfo} to get permissions on all platforms.
188
189References QFileInfo::isDir(), QFileInfo::permissions(), and QFileDevice::Permissions.
190
191\index{QuaZipNewInfo@{QuaZipNewInfo}!setPermissions@{setPermissions}}
192\index{setPermissions@{setPermissions}!QuaZipNewInfo@{QuaZipNewInfo}}
193\subsubsection[{setPermissions}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipNewInfo::setPermissions (
194\begin{DoxyParamCaption}
195\item[{{\bf QFile::Permissions}}]{permissions}
196\end{DoxyParamCaption}
197)}\label{structQuaZipNewInfo_aed68dc20f7dc42b5056491cf3c1d2d20}
198
199
200Sets the file permissions.
201
202Modifies the highest 16 bits of external attributes. The type part is set to dir if the name ends with a slash, and to regular file otherwise.
203
204References QString::endsWith(), and name.
205
206\index{QuaZipNewInfo@{QuaZipNewInfo}!setFileNTFSTimes@{setFileNTFSTimes}}
207\index{setFileNTFSTimes@{setFileNTFSTimes}!QuaZipNewInfo@{QuaZipNewInfo}}
208\subsubsection[{setFileNTFSTimes}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipNewInfo::setFileNTFSTimes (
209\begin{DoxyParamCaption}
210\item[{const {\bf QString} \&}]{fileName}
211\end{DoxyParamCaption}
212)}\label{structQuaZipNewInfo_a663a37c5a7a2d18900ba8b0199617eff}
213
214
215Sets the NTFS times from an existing file.
216
217If the file doesn't exist, a warning is printed to the stderr and nothing is done. Otherwise, all three times, as reported by {\bf QFileInfo::lastModified()}, {\bf QFileInfo::lastRead()} and {\bf QFileInfo::created()}, are written to the NTFS extra field record.
218
219The NTFS record is written to both the local and the global extra fields, updating the existing record if there is one, or creating a new one and appending it to the end of each extra field.
220
221The microseconds will be zero, as they aren't reported by {\bf QFileInfo}.
222\begin{DoxyParams}{Parameters}
223{\em fileName} & \\
224\hline
225\end{DoxyParams}
226
227
228References QByteArray::constData(), QFileInfo::created(), QFileInfo::exists(), QFileInfo::lastModified(), QFileInfo::lastRead(), setFileNTFSaTime(), setFileNTFScTime(), setFileNTFSmTime(), and QString::toUtf8().
229
230\index{QuaZipNewInfo@{QuaZipNewInfo}!setFileNTFSmTime@{setFileNTFSmTime}}
231\index{setFileNTFSmTime@{setFileNTFSmTime}!QuaZipNewInfo@{QuaZipNewInfo}}
232\subsubsection[{setFileNTFSmTime}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipNewInfo::setFileNTFSmTime (
233\begin{DoxyParamCaption}
234\item[{const {\bf QDateTime} \&}]{mTime, }
235\item[{int}]{fineTicks = {\ttfamily 0}}
236\end{DoxyParamCaption}
237)}\label{structQuaZipNewInfo_a3af07365df1d67502ab1d0ca0d45df79}
238
239
240Sets the NTFS modification time.
241
242The time is written into the NTFS record in both the local and the global extra fields, updating the existing record if there is one, or creating a new one and appending it to the end of each extra field. When updating an existing record, all other fields are left intact.
243\begin{DoxyParams}{Parameters}
244{\em mTime} & The new modification time. \\
245\hline
246{\em fineTicks} & The fractional part of milliseconds, in 100-\/nanosecond ticks (i. e. 9999 ticks = 999.9 microsecond). Values greater than 9999 will add milliseconds or even seconds, but this can be confusing and therefore is discouraged. \\
247\hline
248\end{DoxyParams}
249
250
251References extraGlobal, and extraLocal.
252
253
254
255Referenced by setFileNTFSTimes().
256
257\index{QuaZipNewInfo@{QuaZipNewInfo}!setFileNTFSaTime@{setFileNTFSaTime}}
258\index{setFileNTFSaTime@{setFileNTFSaTime}!QuaZipNewInfo@{QuaZipNewInfo}}
259\subsubsection[{setFileNTFSaTime}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipNewInfo::setFileNTFSaTime (
260\begin{DoxyParamCaption}
261\item[{const {\bf QDateTime} \&}]{aTime, }
262\item[{int}]{fineTicks = {\ttfamily 0}}
263\end{DoxyParamCaption}
264)}\label{structQuaZipNewInfo_a1042ac3d55a9deed760eb357aaa8284c}
265
266
267Sets the NTFS access time.
268
269The time is written into the NTFS record in both the local and the global extra fields, updating the existing record if there is one, or creating a new one and appending it to the end of each extra field. When updating an existing record, all other fields are left intact.
270\begin{DoxyParams}{Parameters}
271{\em aTime} & The new access time. \\
272\hline
273{\em fineTicks} & The fractional part of milliseconds, in 100-\/nanosecond ticks (i. e. 9999 ticks = 999.9 microsecond). Values greater than 9999 will add milliseconds or even seconds, but this can be confusing and therefore is discouraged. \\
274\hline
275\end{DoxyParams}
276
277
278References extraGlobal, and extraLocal.
279
280
281
282Referenced by setFileNTFSTimes().
283
284\index{QuaZipNewInfo@{QuaZipNewInfo}!setFileNTFScTime@{setFileNTFScTime}}
285\index{setFileNTFScTime@{setFileNTFScTime}!QuaZipNewInfo@{QuaZipNewInfo}}
286\subsubsection[{setFileNTFScTime}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipNewInfo::setFileNTFScTime (
287\begin{DoxyParamCaption}
288\item[{const {\bf QDateTime} \&}]{cTime, }
289\item[{int}]{fineTicks = {\ttfamily 0}}
290\end{DoxyParamCaption}
291)}\label{structQuaZipNewInfo_a44675ac1e306eddefcaa35972c294d15}
292
293
294Sets the NTFS creation time.
295
296The time is written into the NTFS record in both the local and the global extra fields, updating the existing record if there is one, or creating a new one and appending it to the end of each extra field. When updating an existing record, all other fields are left intact.
297\begin{DoxyParams}{Parameters}
298{\em cTime} & The new creation time. \\
299\hline
300{\em fineTicks} & The fractional part of milliseconds, in 100-\/nanosecond ticks (i. e. 9999 ticks = 999.9 microsecond). Values greater than 9999 will add milliseconds or even seconds, but this can be confusing and therefore is discouraged. \\
301\hline
302\end{DoxyParams}
303
304
305References extraGlobal, and extraLocal.
306
307
308
309Referenced by setFileNTFSTimes().
310
311
312
313\subsection{Member Data Documentation}
314\index{QuaZipNewInfo@{QuaZipNewInfo}!name@{name}}
315\index{name@{name}!QuaZipNewInfo@{QuaZipNewInfo}}
316\subsubsection[{name}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} {\bf QuaZipNewInfo::name}}\label{structQuaZipNewInfo_a2bdef01b6ac3326e48598e32bfa5fbe8}
317
318
319File name.
320
321This field holds file name inside archive, including path relative to archive root.
322
323Referenced by QuaZipFile::open(), and setPermissions().
324
325\index{QuaZipNewInfo@{QuaZipNewInfo}!dateTime@{dateTime}}
326\index{dateTime@{dateTime}!QuaZipNewInfo@{QuaZipNewInfo}}
327\subsubsection[{dateTime}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QDateTime} {\bf QuaZipNewInfo::dateTime}}\label{structQuaZipNewInfo_aec7f3ac72c72a2e10b82ad64c2fa3453}
328
329
330File timestamp.
331
332This is the last file modification date and time. Will be stored in the archive central directory. It is a good practice to set it to the source file timestamp instead of archive creating time. Use \doxyref{setFileDateTime()}{p.}{structQuaZipNewInfo_a2b18b554d056877a2f33ffb9d241ed85} or \doxyref{QuaZipNewInfo(const QString\&, const QString\&)}{p.}{structQuaZipNewInfo_ad47cf11f4277edcb09a8ba2b2963f2a9}.
333
334Referenced by QuaZipFile::open(), QuaZipNewInfo(), and setFileDateTime().
335
336\index{QuaZipNewInfo@{QuaZipNewInfo}!externalAttr@{externalAttr}}
337\index{externalAttr@{externalAttr}!QuaZipNewInfo@{QuaZipNewInfo}}
338\subsubsection[{externalAttr}]{\setlength{\rightskip}{0pt plus 5cm}quint32 {\bf QuaZipNewInfo::externalAttr}}\label{structQuaZipNewInfo_affd1a9700d302e1395bd04f0864da7d0}
339
340
341File external attributes.
342
343The highest 16 bits contain Unix file permissions and type (dir or file). The constructor \doxyref{QuaZipNewInfo(const QString\&, const QString\&)}{p.}{structQuaZipNewInfo_ad47cf11f4277edcb09a8ba2b2963f2a9} takes permissions from the provided file.
344
345Referenced by QuaZipFile::open().
346
347\index{QuaZipNewInfo@{QuaZipNewInfo}!comment@{comment}}
348\index{comment@{comment}!QuaZipNewInfo@{QuaZipNewInfo}}
349\subsubsection[{comment}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} {\bf QuaZipNewInfo::comment}}\label{structQuaZipNewInfo_ae24b1d38c3550b4724862ffcf8f20924}
350
351
352File comment.
353
354Will be encoded using \doxyref{QuaZip::getCommentCodec()}{p.}{classQuaZip_a008260161781d8b5d2a0a28493fddaf4}.
355
356Referenced by QuaZipFile::open().
357
358\index{QuaZipNewInfo@{QuaZipNewInfo}!uncompressedSize@{uncompressedSize}}
359\index{uncompressedSize@{uncompressedSize}!QuaZipNewInfo@{QuaZipNewInfo}}
360\subsubsection[{uncompressedSize}]{\setlength{\rightskip}{0pt plus 5cm}ulong {\bf QuaZipNewInfo::uncompressedSize}}\label{structQuaZipNewInfo_a18c079b3f2f5ab6eecdd61d6dbe93be6}
361
362
363Uncompressed file size.
364
365This is only needed if you are using raw file zipping mode, i. e. adding precompressed file in the zip archive.
366
367Referenced by QuaZipFile::open().
368
369
370
371The documentation for this struct was generated from the following files:\begin{DoxyCompactItemize}
372\item
373quazip/quazipnewinfo.h\item
374quazip/quazipnewinfo.cpp\end{DoxyCompactItemize}
Note: See TracBrowser for help on using the repository browser.