2 % automatically generated by HelpGen $Revision$ from
3 % wx/tarstrm.h at 28/Oct/06 18:27:02
6 \section{\class{wxTarClassFactory
}}\label{wxtarclassfactory
}
8 Class factory for the tar archive format. See the base class
11 \wxheading{Derived from
}
13 \helpref{wxArchiveClassFactory
}{wxarchiveclassfactory
}
15 \wxheading{Include files
}
21 \helpref{Archive formats such as zip
}{wxarc
}\\
22 \helpref{Generic archive programming
}{wxarcgeneric
}\\
23 \helpref{wxTarEntry
}{wxtarentry
}\\
24 \helpref{wxTarInputStream
}{wxtarinputstream
}\\
25 \helpref{wxTarOutputStream
}{wxtaroutputstream
}
29 % automatically generated by HelpGen $Revision$ from
30 % wx/tarstrm.h at 28/Oct/06 18:27:02
33 \section{\class{wxTarEntry
}}\label{wxtarentry
}
35 Holds the meta-data for an entry in a tar.
37 \wxheading{Derived from
}
39 \helpref{wxArchiveEntry
}{wxarchiveentry
}
41 \wxheading{Include files
}
45 \wxheading{Data structures
}
47 Constants for
\helpref{Get/SetTypeFlag
}{wxtarentrytypeflag
}:
52 wxTAR_REGTYPE = '
0', // regular file
53 wxTAR_LNKTYPE = '
1', // hard link
54 wxTAR_SYMTYPE = '
2', // symbolic link
55 wxTAR_CHRTYPE = '
3', // character special
56 wxTAR_BLKTYPE = '
4', // block special
57 wxTAR_DIRTYPE = '
5', // directory
58 wxTAR_FIFOTYPE = '
6', // named pipe
59 wxTAR_CONTTYPE = '
7' // contiguous file
66 \helpref{Archive formats such as zip
}{wxarc
}\\
67 \helpref{wxTarInputStream
}{wxtarinputstream
}\\
68 \helpref{wxTarOutputStream
}{wxtaroutputstream
}
70 \wxheading{Field availability
}
72 The tar format stores all the meta-data for an entry ahead of its data,
73 therefore
\helpref{GetNextEntry()
}{wxtarinputstreamgetnextentry
} always returns
74 a fully populated wxTarEntry object, both when reading from seekable and
78 \latexignore{\rtfignore{\wxheading{Members
}}}
81 \membersection{wxTarEntry::wxTarEntry
}\label{wxtarentrywxtarentry
}
83 \func{}{wxTarEntry
}{\param{const wxString\&
}{name = wxEmptyString
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
},
\param{wxFileOffset
}{size = wxInvalidOffset
}}
85 Constructor. The tar archive format stores the entry's size ahead of the
86 entry's data. Therefore when creating an archive on a non-seekable stream it
87 is necessary to supply the correct size when each entry is created.
89 \func{}{wxTarEntry
}{\param{const wxTarEntry\&
}{entry
}}
94 \membersection{wxTarEntry::Get/SetAccessTime
}\label{wxtarentryaccesstime
}
96 \constfunc{wxDateTime
}{GetAccessTime
}{\void}
98 \func{void
}{SetAccessTime
}{\param{const wxDateTime\&
}{dt
}}
100 The entry's access time stamp. See also
101 \helpref{wxArchiveEntry::Get/SetDateTime
}{wxarchiveentrydatetime
}.
104 \membersection{wxTarEntry::Get/SetCreateTime
}\label{wxtarentrycreatetime
}
106 \constfunc{wxDateTime
}{GetCreateTime
}{\void}
108 \func{void
}{SetCreateTime
}{\param{const wxDateTime\&
}{dt
}}
110 The entry's creation time stamp. See also
111 \helpref{wxArchiveEntry::Get/SetDateTime
}{wxarchiveentrydatetime
}.
114 \membersection{wxTarEntry::Get/SetDevMajor and Get/SetDevMinor
}\label{wxtarentrydev
}
116 \constfunc{int
}{GetDevMajor
}{\void}
118 \constfunc{int
}{GetDevMinor
}{\void}
120 \func{void
}{SetDevMajor
}{\param{int
}{dev
}}
122 \func{void
}{SetDevMinor
}{\param{int
}{dev
}}
124 OS specific IDs defining a device, these are only meaningful when
125 \helpref{TypeFlag
}{wxtarentrytypeflag
} is set to
{\it wxTAR
\_CHRTYPE}
126 or
{\it wxTAR
\_BLKTYPE}.
129 \membersection{wxTarEntry::Get/SetGroupId and Get/SetUserId
}\label{wxtarentryuidgid
}
131 \constfunc{int
}{GetGroupId
}{\void}
133 \constfunc{int
}{GetUserId
}{\void}
135 \func{void
}{SetGroupId
}{\param{int
}{id
}}
137 \func{void
}{SetUserId
}{\param{int
}{id
}}
139 The user ID and group ID that has
\helpref{permissions
}{wxtarentrymode
} over
140 this entry. These values aren't usually useful unless the file will only be
141 restored to the same system it originated from.
\helpref{Get/SetGroupName and
142 Get/SetUserName
}{wxtarentryunamegname
} can be used instead.
145 \membersection{wxTarEntry::Get/SetGroupName and Get/SetUserName
}\label{wxtarentryunamegname
}
147 \constfunc{wxString
}{GetGroupName
}{\void}
149 \constfunc{wxString
}{GetUserName
}{\void}
151 \func{void
}{SetGroupName
}{\param{const wxString\&
}{group
}}
153 \func{void
}{SetUserName
}{\param{const wxString\&
}{user
}}
155 The names of the user and group that has
\helpref{permissions
}{wxtarentrymode
}
156 over this entry. These are not present in very old tars.
159 \membersection{wxTarEntry::GetInternalName
}\label{wxtarentrygetinternalname
}
161 \constfunc{wxString
}{GetInternalName
}{\void}
163 Returns the entry's filename in the internal format used within the
164 archive. The name can include directory components, i.e. it can be a
167 The names of directory entries are returned without any trailing path
168 separator. This gives a canonical name that can be used in comparisons.
170 \func{wxString
}{GetInternalName
}{\param{const wxString\&
}{name
},
\param{wxPathFormat
}{format = wxPATH
\_NATIVE},
\param{bool*
}{pIsDir = NULL
}}
172 A static member that translates a filename into the internal format used
173 within the archive. If the third parameter is provided, the bool pointed
174 to is set to indicate whether the name looks like a directory name
175 (i.e. has a trailing path separator).
178 \membersection{wxTarEntry::Get/SetLinkName
}\label{wxtarentrylinkname
}
180 \constfunc{wxString
}{GetLinkName
}{\void}
182 \func{void
}{SetLinkName
}{\param{const wxString\&
}{link
}}
184 The filename of a previous entry in the tar that this entry is a link to.
185 Only meaningful when
\helpref{TypeFlag
}{wxtarentrytypeflag
} is set
186 to
{\it wxTAR
\_LNKTYPE} or
{\it wxTAR
\_SYMTYPE}.
189 \membersection{wxTarEntry::Get/SetMode
}\label{wxtarentrymode
}
191 \constfunc{int
}{GetMode
}{\void}
193 \func{void
}{SetMode
}{\param{int
}{mode
}}
195 UNIX permission bits for this entry. Giving read, write and execute permissions
196 to the file's
\helpref{User and Group
}{wxtarentryunamegname
} and to others.
197 Symbols are defined for them in <wx/file.h>.
200 #define wxS_IRUSR
00400
201 #define wxS_IWUSR
00200
202 #define wxS_IXUSR
00100
204 #define wxS_IRGRP
00040
205 #define wxS_IWGRP
00020
206 #define wxS_IXGRP
00010
208 #define wxS_IROTH
00004
209 #define wxS_IWOTH
00002
210 #define wxS_IXOTH
00001
215 \membersection{wxTarEntry::Get/SetSize
}\label{wxtarentrysize
}
217 \func{void
}{SetSize
}{\param{wxFileOffset
}{size
}}
219 \constfunc{wxFileOffset
}{GetSize
}{\void}
221 The size of the entry's data in bytes.
223 The tar archive format stores the entry's size ahead of the entry's data.
224 Therefore when creating an archive on a non-seekable stream it is necessary to
225 supply the correct size when each entry is created. For seekable streams this
226 is not necessary as
\helpref{wxTarOutputStream
}{wxtaroutputstream
} will attempt
227 to seek back and fix the entry's header when the entry is closed, though it is
228 still more efficient if the size is given beforehand.
231 \membersection{wxTarEntry::Get/SetTypeFlag
}\label{wxtarentrytypeflag
}
233 \constfunc{int
}{GetTypeFlag
}{\void}
235 \func{void
}{SetTypeFlag
}{\param{int
}{type
}}
237 Returns the type of the entry. It should be one of the following:
242 wxTAR_REGTYPE = '
0', // regular file
243 wxTAR_LNKTYPE = '
1', // hard link
244 wxTAR_SYMTYPE = '
2', // symbolic link
245 wxTAR_CHRTYPE = '
3', // character special
246 wxTAR_BLKTYPE = '
4', // block special
247 wxTAR_DIRTYPE = '
5', // directory
248 wxTAR_FIFOTYPE = '
6', // named pipe
249 wxTAR_CONTTYPE = '
7' // contiguous file
254 When creating archives use just these values. When reading archives
255 any other values should be treated as
{\it wxTAR
\_REGTYPE}.
258 \membersection{wxTarEntry::operator=
}\label{wxtarentryoperatorassign
}
260 \func{wxTarEntry\& operator
}{operator=
}{\param{const wxTarEntry\&
}{entry
}}
266 % automatically generated by HelpGen $Revision$ from
267 % wx/tarstrm.h at 28/Oct/06 18:27:02
270 \section{\class{wxTarInputStream
}}\label{wxtarinputstream
}
272 Input stream for reading tar files.
274 \helpref{GetNextEntry()
}{wxtarinputstreamgetnextentry
} returns an
275 \helpref{wxTarEntry
}{wxtarentry
} object containing the meta-data
276 for the next entry in the tar (and gives away ownership). Reading from
277 the wxTarInputStream then returns the entry's data. Eof() becomes true
278 after an attempt has been made to read past the end of the entry's data.
279 When there are no more entries, GetNextEntry() returns NULL and sets Eof().
281 Tar entries are seekable if the parent stream is seekable. In practice this
282 usually means they are only seekable if the tar is stored as a local file and
285 \wxheading{Derived from
}
287 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}
289 \wxheading{Include files
}
293 \wxheading{Data structures
}
295 typedef wxTarEntry entry_type
298 \helpref{Archive formats such as zip
}{wxarc
}\\
299 \helpref{wxTarEntry
}{wxtarentry
}\\
300 \helpref{wxTarOutputStream
}{wxtaroutputstream
}
302 \latexignore{\rtfignore{\wxheading{Members
}}}
305 \membersection{wxTarInputStream::wxTarInputStream
}\label{wxtarinputstreamwxtarinputstream
}
307 \func{}{wxTarInputStream
}{\param{wxInputStream\&
}{stream
},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
309 \func{}{wxTarInputStream
}{\param{wxInputStream*
}{stream
},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
311 Constructor. In a Unicode build the second parameter
{\it conv
} is
312 used to translate fields from the standard tar header into Unicode. It has
313 no effect on the stream's data.
{\it conv
} is only used for the standard
314 tar headers, any pax extended headers are always UTF-
8 encoded.
316 If the parent stream is passed as a pointer then the new filter stream
317 takes ownership of it. If it is passed by reference then it does not.
320 \membersection{wxTarInputStream::CloseEntry
}\label{wxtarinputstreamcloseentry
}
322 \func{bool
}{CloseEntry
}{\void}
324 Closes the current entry. On a non-seekable stream reads to the end of
325 the current entry first.
328 \membersection{wxTarInputStream::GetNextEntry
}\label{wxtarinputstreamgetnextentry
}
330 \func{wxTarEntry*
}{GetNextEntry
}{\void}
332 Closes the current entry if one is open, then reads the meta-data for
333 the next entry and returns it in a
\helpref{wxTarEntry
}{wxtarentry
}
334 object, giving away ownership. The stream is then open and can be read.
337 \membersection{wxTarInputStream::OpenEntry
}\label{wxtarinputstreamopenentry
}
339 \func{bool
}{OpenEntry
}{\param{wxTarEntry\&
}{entry
}}
341 Closes the current entry if one is open, then opens the entry specified
342 by the
{\it entry
} object.
344 {\it entry
} should be from the same tar file, and the tar should
345 be on a seekable stream.
349 \helpref{Looking up an archive entry by name
}{wxarcbyname
}
353 % automatically generated by HelpGen $Revision$ from
354 % wx/tarstrm.h at 28/Oct/06 18:27:02
357 \section{\class{wxTarOutputStream
}}\label{wxtaroutputstream
}
359 Output stream for writing tar files.
361 \helpref{PutNextEntry()
}{wxtaroutputstreamputnextentry
} is used to create
362 a new entry in the output tar, then the entry's data is written to the
363 wxTarOutputStream. Another call to PutNextEntry() closes the current
364 entry and begins the next.
366 \wxheading{Derived from
}
368 \helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}
370 \wxheading{Include files
}
374 \wxheading{Data structures
}
376 Constants for the
{\it format
} parameter of the
377 \helpref{constructor
}{wxtaroutputstreamwxtaroutputstream
}.
380 // Archive Formats (use wxTAR_PAX, it's backward compatible)
383 wxTAR_USTAR, // POSIX
.1-
1990 tar format
384 wxTAR_PAX // POSIX
.1-
2001 tar format
391 \helpref{Archive formats such as zip
}{wxarc
}\\
392 \helpref{wxTarEntry
}{wxtarentry
}\\
393 \helpref{wxTarInputStream
}{wxtarinputstream
}
396 \latexignore{\rtfignore{\wxheading{Members
}}}
399 \membersection{wxTarOutputStream::wxTarOutputStream
}\label{wxtaroutputstreamwxtaroutputstream
}
401 \func{}{wxTarOutputStream
}{\param{wxOutputStream\&
}{stream
},
\param{wxTarFormat
}{format = wxTAR
\_PAX},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
403 \func{}{wxTarOutputStream
}{\param{wxOutputStream*
}{stream
},
\param{wxTarFormat
}{format = wxTAR
\_PAX},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
405 If the parent stream is passed as a pointer then the new filter stream
406 takes ownership of it. If it is passed by reference then it does not.
408 In a Unicode build the third parameter
{\it conv
} is used to translate the
409 headers fields into an
8-bit encoding. It has no effect on the stream's data.
411 When the
{\it format
} is
{\it wxTAR
\_PAX}, pax extended headers are generated
412 when any header field will not fit the standard tar header block or if it
413 uses any non-ascii characters.
415 Extended headers are stored as extra 'files' within the tar, and will be
416 extracted as such by any other tar program that does not understand them.
417 The
{\it conv
} parameter only affect the standard tar headers, the extended
418 headers are always UTF-
8 encoded.
420 When the
{\it format
} is
{\it wxTAR
\_USTAR}, no extended headers are
421 generated, and instead a warning message is logged if any header field
425 \membersection{wxTarOutputStream::
\destruct{wxTarOutputStream
}}\label{wxtaroutputstreamdtor
}
427 \func{}{\destruct{wxTarOutputStream
}}{\void}
429 The destructor calls
\helpref{Close()
}{wxtaroutputstreamclose
} to finish
430 writing the tar if it has not been called already.
433 \membersection{wxTarOutputStream::Close
}\label{wxtaroutputstreamclose
}
435 \func{bool
}{Close
}{\void}
437 Finishes writing the tar, returning true if successful.
438 Called by the destructor if not called explicitly.
441 \membersection{wxTarOutputStream::CloseEntry
}\label{wxtaroutputstreamcloseentry
}
443 \func{bool
}{CloseEntry
}{\void}
445 Close the current entry. It is called implicitly whenever another new
446 entry is created with
\helpref{CopyEntry()
}{wxtaroutputstreamcopyentry
}
447 or
\helpref{PutNextEntry()
}{wxtaroutputstreamputnextentry
}, or
448 when the tar is closed.
451 \membersection{wxTarOutputStream::CopyArchiveMetaData
}\label{wxtaroutputstreamcopyarchivemetadata
}
453 \func{bool
}{CopyArchiveMetaData
}{\param{wxTarInputStream\&
}{s
}}
455 See
\helpref{wxArchiveOutputStream::CopyArchiveMetaData
}{wxarchiveoutputstreamcopyarchivemetadata
}.
456 For the tar format this function does nothing.
459 \membersection{wxTarOutputStream::CopyEntry
}\label{wxtaroutputstreamcopyentry
}
461 \func{bool
}{CopyEntry
}{\param{wxTarEntry*
}{entry
},
\param{wxTarInputStream\&
}{inputStream
}}
463 Takes ownership of
{\it entry
} and uses it to create a new entry
464 in the tar.
{\it entry
} is then opened in
{\it inputStream
} and its contents
465 copied to this stream.
467 For some other archive formats CopyEntry() is much more efficient than
468 transferring the data using Read() and Write() since it will copy them
469 without decompressing and recompressing them. For tar however it makes
472 For tars on seekable streams,
{\it entry
} must be from the same tar file
473 as
{\it stream
}. For non-seekable streams,
{\it entry
} must also be the
474 last thing read from
{\it inputStream
}.
477 \membersection{wxTarOutputStream::Get/SetBlockingFactor
}\label{wxtaroutputstreamblockingfactor
}
479 \constfunc{int
}{GetBlockingFactor
}{\void}
481 \func{void
}{SetBlockingFactor
}{\param{int
}{factor
}}
483 The tar is zero padded to round its size up to
{\it BlockingFactor *
512} bytes.
485 Defaults to
10 for
{\it wxTAR
\_PAX} and
20 for
{\it wxTAR
\_USTAR}
486 (see the
\helpref{constructor
}{wxtaroutputstreamwxtaroutputstream
}), as
487 specified in the POSIX standards.
490 \membersection{wxTarOutputStream::PutNextDirEntry
}\label{wxtaroutputstreamputnextdirentry
}
492 \func{bool
}{PutNextDirEntry
}{\param{const wxString\&
}{name
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
}}
494 Create a new directory entry
495 (see
\helpref{wxArchiveEntry::IsDir()
}{wxarchiveentryisdir
})
496 with the given name and timestamp.
498 \helpref{PutNextEntry()
}{wxtaroutputstreamputnextentry
} can
499 also be used to create directory entries, by supplying a name with
500 a trailing path separator.
503 \membersection{wxTarOutputStream::PutNextEntry
}\label{wxtaroutputstreamputnextentry
}
505 \func{bool
}{PutNextEntry
}{\param{wxTarEntry*
}{entry
}}
507 Takes ownership of
{\it entry
} and uses it to create a new entry
510 \func{bool
}{PutNextEntry
}{\param{const wxString\&
}{name
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
},
\param{wxFileOffset
}{size = wxInvalidOffset
}}
512 Create a new entry with the given name, timestamp and size.