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{wxBase
}{librarieslist
}
25 \helpref{Archive formats such as zip
}{wxarc
}\\
26 \helpref{Generic archive programming
}{wxarcgeneric
}\\
27 \helpref{wxTarEntry
}{wxtarentry
}\\
28 \helpref{wxTarInputStream
}{wxtarinputstream
}\\
29 \helpref{wxTarOutputStream
}{wxtaroutputstream
}
33 % automatically generated by HelpGen $Revision$ from
34 % wx/tarstrm.h at 28/Oct/06 18:27:02
37 \section{\class{wxTarEntry
}}\label{wxtarentry
}
39 Holds the meta-data for an entry in a tar.
41 \wxheading{Derived from
}
43 \helpref{wxArchiveEntry
}{wxarchiveentry
}
45 \wxheading{Include files
}
51 \helpref{wxBase
}{librarieslist
}
53 \wxheading{Data structures
}
55 Constants for
\helpref{Get/SetTypeFlag
}{wxtarentrytypeflag
}:
60 wxTAR_REGTYPE = '
0', // regular file
61 wxTAR_LNKTYPE = '
1', // hard link
62 wxTAR_SYMTYPE = '
2', // symbolic link
63 wxTAR_CHRTYPE = '
3', // character special
64 wxTAR_BLKTYPE = '
4', // block special
65 wxTAR_DIRTYPE = '
5', // directory
66 wxTAR_FIFOTYPE = '
6', // named pipe
67 wxTAR_CONTTYPE = '
7' // contiguous file
74 \helpref{Archive formats such as zip
}{wxarc
}\\
75 \helpref{wxTarInputStream
}{wxtarinputstream
}\\
76 \helpref{wxTarOutputStream
}{wxtaroutputstream
}
78 \wxheading{Field availability
}
80 The tar format stores all the meta-data for an entry ahead of its data,
81 therefore
\helpref{GetNextEntry()
}{wxtarinputstreamgetnextentry
} always returns
82 a fully populated wxTarEntry object, both when reading from seekable and
86 \latexignore{\rtfignore{\wxheading{Members
}}}
89 \membersection{wxTarEntry::wxTarEntry
}\label{wxtarentrywxtarentry
}
91 \func{}{wxTarEntry
}{\param{const wxString\&
}{name = wxEmptyString
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
},
\param{wxFileOffset
}{size = wxInvalidOffset
}}
93 Constructor. The tar archive format stores the entry's size ahead of the
94 entry's data. Therefore when creating an archive on a non-seekable stream it
95 is necessary to supply the correct size when each entry is created.
97 \func{}{wxTarEntry
}{\param{const wxTarEntry\&
}{entry
}}
102 \membersection{wxTarEntry::Get/SetAccessTime
}\label{wxtarentryaccesstime
}
104 \constfunc{wxDateTime
}{GetAccessTime
}{\void}
106 \func{void
}{SetAccessTime
}{\param{const wxDateTime\&
}{dt
}}
108 The entry's access time stamp. See also
109 \helpref{wxArchiveEntry::Get/SetDateTime
}{wxarchiveentrydatetime
}.
112 \membersection{wxTarEntry::Get/SetCreateTime
}\label{wxtarentrycreatetime
}
114 \constfunc{wxDateTime
}{GetCreateTime
}{\void}
116 \func{void
}{SetCreateTime
}{\param{const wxDateTime\&
}{dt
}}
118 The entry's creation time stamp. See also
119 \helpref{wxArchiveEntry::Get/SetDateTime
}{wxarchiveentrydatetime
}.
122 \membersection{wxTarEntry::Get/SetDevMajor and Get/SetDevMinor
}\label{wxtarentrydev
}
124 \constfunc{int
}{GetDevMajor
}{\void}
126 \constfunc{int
}{GetDevMinor
}{\void}
128 \func{void
}{SetDevMajor
}{\param{int
}{dev
}}
130 \func{void
}{SetDevMinor
}{\param{int
}{dev
}}
132 OS specific IDs defining a device, these are only meaningful when
133 \helpref{TypeFlag
}{wxtarentrytypeflag
} is set to
{\it wxTAR
\_CHRTYPE}
134 or
{\it wxTAR
\_BLKTYPE}.
137 \membersection{wxTarEntry::Get/SetGroupId and Get/SetUserId
}\label{wxtarentryuidgid
}
139 \constfunc{int
}{GetGroupId
}{\void}
141 \constfunc{int
}{GetUserId
}{\void}
143 \func{void
}{SetGroupId
}{\param{int
}{id
}}
145 \func{void
}{SetUserId
}{\param{int
}{id
}}
147 The user ID and group ID that has
\helpref{permissions
}{wxtarentrymode
} over
148 this entry. These values aren't usually useful unless the file will only be
149 restored to the same system it originated from.
\helpref{Get/SetGroupName and
150 Get/SetUserName
}{wxtarentryunamegname
} can be used instead.
153 \membersection{wxTarEntry::Get/SetGroupName and Get/SetUserName
}\label{wxtarentryunamegname
}
155 \constfunc{wxString
}{GetGroupName
}{\void}
157 \constfunc{wxString
}{GetUserName
}{\void}
159 \func{void
}{SetGroupName
}{\param{const wxString\&
}{group
}}
161 \func{void
}{SetUserName
}{\param{const wxString\&
}{user
}}
163 The names of the user and group that has
\helpref{permissions
}{wxtarentrymode
}
164 over this entry. These are not present in very old tars.
167 \membersection{wxTarEntry::GetInternalName
}\label{wxtarentrygetinternalname
}
169 \constfunc{wxString
}{GetInternalName
}{\void}
171 Returns the entry's filename in the internal format used within the
172 archive. The name can include directory components, i.e. it can be a
175 The names of directory entries are returned without any trailing path
176 separator. This gives a canonical name that can be used in comparisons.
178 \func{wxString
}{GetInternalName
}{\param{const wxString\&
}{name
},
\param{wxPathFormat
}{format = wxPATH
\_NATIVE},
\param{bool*
}{pIsDir = NULL
}}
180 A static member that translates a filename into the internal format used
181 within the archive. If the third parameter is provided, the bool pointed
182 to is set to indicate whether the name looks like a directory name
183 (i.e. has a trailing path separator).
186 \membersection{wxTarEntry::Get/SetLinkName
}\label{wxtarentrylinkname
}
188 \constfunc{wxString
}{GetLinkName
}{\void}
190 \func{void
}{SetLinkName
}{\param{const wxString\&
}{link
}}
192 The filename of a previous entry in the tar that this entry is a link to.
193 Only meaningful when
\helpref{TypeFlag
}{wxtarentrytypeflag
} is set
194 to
{\it wxTAR
\_LNKTYPE} or
{\it wxTAR
\_SYMTYPE}.
197 \membersection{wxTarEntry::Get/SetMode
}\label{wxtarentrymode
}
199 \constfunc{int
}{GetMode
}{\void}
201 \func{void
}{SetMode
}{\param{int
}{mode
}}
203 UNIX permission bits for this entry. Giving read, write and execute permissions
204 to the file's
\helpref{User and Group
}{wxtarentryunamegname
} and to others.
205 Symbols are defined for them in <wx/file.h>.
208 #define wxS_IRUSR
00400
209 #define wxS_IWUSR
00200
210 #define wxS_IXUSR
00100
212 #define wxS_IRGRP
00040
213 #define wxS_IWGRP
00020
214 #define wxS_IXGRP
00010
216 #define wxS_IROTH
00004
217 #define wxS_IWOTH
00002
218 #define wxS_IXOTH
00001
223 \membersection{wxTarEntry::Get/SetSize
}\label{wxtarentrysize
}
225 \func{void
}{SetSize
}{\param{wxFileOffset
}{size
}}
227 \constfunc{wxFileOffset
}{GetSize
}{\void}
229 The size of the entry's data in bytes.
231 The tar archive format stores the entry's size ahead of the entry's data.
232 Therefore when creating an archive on a non-seekable stream it is necessary to
233 supply the correct size when each entry is created. For seekable streams this
234 is not necessary as
\helpref{wxTarOutputStream
}{wxtaroutputstream
} will attempt
235 to seek back and fix the entry's header when the entry is closed, though it is
236 still more efficient if the size is given beforehand.
239 \membersection{wxTarEntry::Get/SetTypeFlag
}\label{wxtarentrytypeflag
}
241 \constfunc{int
}{GetTypeFlag
}{\void}
243 \func{void
}{SetTypeFlag
}{\param{int
}{type
}}
245 Returns the type of the entry. It should be one of the following:
250 wxTAR_REGTYPE = '
0', // regular file
251 wxTAR_LNKTYPE = '
1', // hard link
252 wxTAR_SYMTYPE = '
2', // symbolic link
253 wxTAR_CHRTYPE = '
3', // character special
254 wxTAR_BLKTYPE = '
4', // block special
255 wxTAR_DIRTYPE = '
5', // directory
256 wxTAR_FIFOTYPE = '
6', // named pipe
257 wxTAR_CONTTYPE = '
7' // contiguous file
262 When creating archives use just these values. When reading archives
263 any other values should be treated as
{\it wxTAR
\_REGTYPE}.
266 \membersection{wxTarEntry::operator=
}\label{wxtarentryoperatorassign
}
268 \func{wxTarEntry\& operator
}{operator=
}{\param{const wxTarEntry\&
}{entry
}}
274 % automatically generated by HelpGen $Revision$ from
275 % wx/tarstrm.h at 28/Oct/06 18:27:02
278 \section{\class{wxTarInputStream
}}\label{wxtarinputstream
}
280 Input stream for reading tar files.
282 \helpref{GetNextEntry()
}{wxtarinputstreamgetnextentry
} returns an
283 \helpref{wxTarEntry
}{wxtarentry
} object containing the meta-data
284 for the next entry in the tar (and gives away ownership). Reading from
285 the wxTarInputStream then returns the entry's data. Eof() becomes true
286 after an attempt has been made to read past the end of the entry's data.
287 When there are no more entries, GetNextEntry() returns NULL and sets Eof().
289 Tar entries are seekable if the parent stream is seekable. In practice this
290 usually means they are only seekable if the tar is stored as a local file and
293 \wxheading{Derived from
}
295 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}
297 \wxheading{Include files
}
303 \helpref{wxBase
}{librarieslist
}
305 \wxheading{Data structures
}
307 typedef wxTarEntry entry_type
310 \helpref{Archive formats such as zip
}{wxarc
}\\
311 \helpref{wxTarEntry
}{wxtarentry
}\\
312 \helpref{wxTarOutputStream
}{wxtaroutputstream
}
314 \latexignore{\rtfignore{\wxheading{Members
}}}
317 \membersection{wxTarInputStream::wxTarInputStream
}\label{wxtarinputstreamwxtarinputstream
}
319 \func{}{wxTarInputStream
}{\param{wxInputStream\&
}{stream
},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
321 \func{}{wxTarInputStream
}{\param{wxInputStream*
}{stream
},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
323 Constructor. In a Unicode build the second parameter
{\it conv
} is
324 used to translate fields from the standard tar header into Unicode. It has
325 no effect on the stream's data.
{\it conv
} is only used for the standard
326 tar headers, any pax extended headers are always UTF-
8 encoded.
328 If the parent stream is passed as a pointer then the new filter stream
329 takes ownership of it. If it is passed by reference then it does not.
332 \membersection{wxTarInputStream::CloseEntry
}\label{wxtarinputstreamcloseentry
}
334 \func{bool
}{CloseEntry
}{\void}
336 Closes the current entry. On a non-seekable stream reads to the end of
337 the current entry first.
340 \membersection{wxTarInputStream::GetNextEntry
}\label{wxtarinputstreamgetnextentry
}
342 \func{wxTarEntry*
}{GetNextEntry
}{\void}
344 Closes the current entry if one is open, then reads the meta-data for
345 the next entry and returns it in a
\helpref{wxTarEntry
}{wxtarentry
}
346 object, giving away ownership. The stream is then open and can be read.
349 \membersection{wxTarInputStream::OpenEntry
}\label{wxtarinputstreamopenentry
}
351 \func{bool
}{OpenEntry
}{\param{wxTarEntry\&
}{entry
}}
353 Closes the current entry if one is open, then opens the entry specified
354 by the
{\it entry
} object.
356 {\it entry
} should be from the same tar file, and the tar should
357 be on a seekable stream.
361 \helpref{Looking up an archive entry by name
}{wxarcbyname
}
365 % automatically generated by HelpGen $Revision$ from
366 % wx/tarstrm.h at 28/Oct/06 18:27:02
369 \section{\class{wxTarOutputStream
}}\label{wxtaroutputstream
}
371 Output stream for writing tar files.
373 \helpref{PutNextEntry()
}{wxtaroutputstreamputnextentry
} is used to create
374 a new entry in the output tar, then the entry's data is written to the
375 wxTarOutputStream. Another call to PutNextEntry() closes the current
376 entry and begins the next.
378 \wxheading{Derived from
}
380 \helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}
382 \wxheading{Include files
}
388 \helpref{wxBase
}{librarieslist
}
390 \wxheading{Data structures
}
392 Constants for the
{\it format
} parameter of the
393 \helpref{constructor
}{wxtaroutputstreamwxtaroutputstream
}.
396 // Archive Formats (use wxTAR_PAX, it's backward compatible)
399 wxTAR_USTAR, // POSIX
.1-
1990 tar format
400 wxTAR_PAX // POSIX
.1-
2001 tar format
407 \helpref{Archive formats such as zip
}{wxarc
}\\
408 \helpref{wxTarEntry
}{wxtarentry
}\\
409 \helpref{wxTarInputStream
}{wxtarinputstream
}
412 \latexignore{\rtfignore{\wxheading{Members
}}}
415 \membersection{wxTarOutputStream::wxTarOutputStream
}\label{wxtaroutputstreamwxtaroutputstream
}
417 \func{}{wxTarOutputStream
}{\param{wxOutputStream\&
}{stream
},
\param{wxTarFormat
}{format = wxTAR
\_PAX},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
419 \func{}{wxTarOutputStream
}{\param{wxOutputStream*
}{stream
},
\param{wxTarFormat
}{format = wxTAR
\_PAX},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
421 If the parent stream is passed as a pointer then the new filter stream
422 takes ownership of it. If it is passed by reference then it does not.
424 In a Unicode build the third parameter
{\it conv
} is used to translate the
425 headers fields into an
8-bit encoding. It has no effect on the stream's data.
427 When the
{\it format
} is
{\it wxTAR
\_PAX}, pax extended headers are generated
428 when any header field will not fit the standard tar header block or if it
429 uses any non-ascii characters.
431 Extended headers are stored as extra 'files' within the tar, and will be
432 extracted as such by any other tar program that does not understand them.
433 The
{\it conv
} parameter only affect the standard tar headers, the extended
434 headers are always UTF-
8 encoded.
436 When the
{\it format
} is
{\it wxTAR
\_USTAR}, no extended headers are
437 generated, and instead a warning message is logged if any header field
441 \membersection{wxTarOutputStream::
\destruct{wxTarOutputStream
}}\label{wxtaroutputstreamdtor
}
443 \func{}{\destruct{wxTarOutputStream
}}{\void}
445 The destructor calls
\helpref{Close()
}{wxtaroutputstreamclose
} to finish
446 writing the tar if it has not been called already.
449 \membersection{wxTarOutputStream::Close
}\label{wxtaroutputstreamclose
}
451 \func{bool
}{Close
}{\void}
453 Finishes writing the tar, returning true if successful.
454 Called by the destructor if not called explicitly.
457 \membersection{wxTarOutputStream::CloseEntry
}\label{wxtaroutputstreamcloseentry
}
459 \func{bool
}{CloseEntry
}{\void}
461 Close the current entry. It is called implicitly whenever another new
462 entry is created with
\helpref{CopyEntry()
}{wxtaroutputstreamcopyentry
}
463 or
\helpref{PutNextEntry()
}{wxtaroutputstreamputnextentry
}, or
464 when the tar is closed.
467 \membersection{wxTarOutputStream::CopyArchiveMetaData
}\label{wxtaroutputstreamcopyarchivemetadata
}
469 \func{bool
}{CopyArchiveMetaData
}{\param{wxTarInputStream\&
}{s
}}
471 See
\helpref{wxArchiveOutputStream::CopyArchiveMetaData
}{wxarchiveoutputstreamcopyarchivemetadata
}.
472 For the tar format this function does nothing.
475 \membersection{wxTarOutputStream::CopyEntry
}\label{wxtaroutputstreamcopyentry
}
477 \func{bool
}{CopyEntry
}{\param{wxTarEntry*
}{entry
},
\param{wxTarInputStream\&
}{inputStream
}}
479 Takes ownership of
{\it entry
} and uses it to create a new entry
480 in the tar.
{\it entry
} is then opened in
{\it inputStream
} and its contents
481 copied to this stream.
483 For some other archive formats CopyEntry() is much more efficient than
484 transferring the data using Read() and Write() since it will copy them
485 without decompressing and recompressing them. For tar however it makes
488 For tars on seekable streams,
{\it entry
} must be from the same tar file
489 as
{\it stream
}. For non-seekable streams,
{\it entry
} must also be the
490 last thing read from
{\it inputStream
}.
493 \membersection{wxTarOutputStream::Get/SetBlockingFactor
}\label{wxtaroutputstreamblockingfactor
}
495 \constfunc{int
}{GetBlockingFactor
}{\void}
497 \func{void
}{SetBlockingFactor
}{\param{int
}{factor
}}
499 The tar is zero padded to round its size up to
{\it BlockingFactor *
512} bytes.
501 Defaults to
10 for
{\it wxTAR
\_PAX} and
20 for
{\it wxTAR
\_USTAR}
502 (see the
\helpref{constructor
}{wxtaroutputstreamwxtaroutputstream
}), as
503 specified in the POSIX standards.
506 \membersection{wxTarOutputStream::PutNextDirEntry
}\label{wxtaroutputstreamputnextdirentry
}
508 \func{bool
}{PutNextDirEntry
}{\param{const wxString\&
}{name
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
}}
510 Create a new directory entry
511 (see
\helpref{wxArchiveEntry::IsDir()
}{wxarchiveentryisdir
})
512 with the given name and timestamp.
514 \helpref{PutNextEntry()
}{wxtaroutputstreamputnextentry
} can
515 also be used to create directory entries, by supplying a name with
516 a trailing path separator.
519 \membersection{wxTarOutputStream::PutNextEntry
}\label{wxtaroutputstreamputnextentry
}
521 \func{bool
}{PutNextEntry
}{\param{wxTarEntry*
}{entry
}}
523 Takes ownership of
{\it entry
} and uses it to create a new entry
526 \func{bool
}{PutNextEntry
}{\param{const wxString\&
}{name
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
},
\param{wxFileOffset
}{size = wxInvalidOffset
}}
528 Create a new entry with the given name, timestamp and size.