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
}\\
14 \helpref{wxObject
}{wxobject
}
16 \wxheading{Include files
}
22 \helpref{wxBase
}{librarieslist
}
26 \helpref{Archive formats such as zip
}{wxarc
}\\
27 \helpref{Generic archive programming
}{wxarcgeneric
}\\
28 \helpref{wxTarEntry
}{wxtarentry
}\\
29 \helpref{wxTarInputStream
}{wxtarinputstream
}\\
30 \helpref{wxTarOutputStream
}{wxtaroutputstream
}
34 % automatically generated by HelpGen $Revision$ from
35 % wx/tarstrm.h at 28/Oct/06 18:27:02
38 \section{\class{wxTarEntry
}}\label{wxtarentry
}
40 Holds the meta-data for an entry in a tar.
42 \wxheading{Derived from
}
44 \helpref{wxArchiveEntry
}{wxarchiveentry
}\\
45 \helpref{wxObject
}{wxobject
}
47 \wxheading{Include files
}
53 \helpref{wxBase
}{librarieslist
}
55 \wxheading{Data structures
}
57 Constants for
\helpref{Get/SetTypeFlag
}{wxtarentrytypeflag
}:
62 wxTAR_REGTYPE = '
0', // regular file
63 wxTAR_LNKTYPE = '
1', // hard link
64 wxTAR_SYMTYPE = '
2', // symbolic link
65 wxTAR_CHRTYPE = '
3', // character special
66 wxTAR_BLKTYPE = '
4', // block special
67 wxTAR_DIRTYPE = '
5', // directory
68 wxTAR_FIFOTYPE = '
6', // named pipe
69 wxTAR_CONTTYPE = '
7' // contiguous file
76 \helpref{Archive formats such as zip
}{wxarc
}\\
77 \helpref{wxTarInputStream
}{wxtarinputstream
}\\
78 \helpref{wxTarOutputStream
}{wxtaroutputstream
}
80 \wxheading{Field availability
}
82 The tar format stores all the meta-data for an entry ahead of its data,
83 therefore
\helpref{GetNextEntry()
}{wxtarinputstreamgetnextentry
} always returns
84 a fully populated wxTarEntry object, both when reading from seekable and
88 \latexignore{\rtfignore{\wxheading{Members
}}}
91 \membersection{wxTarEntry::wxTarEntry
}\label{wxtarentrywxtarentry
}
93 \func{}{wxTarEntry
}{\param{const wxString\&
}{name = wxEmptyString
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
},
\param{wxFileOffset
}{size = wxInvalidOffset
}}
95 Constructor. The tar archive format stores the entry's size ahead of the
96 entry's data. Therefore when creating an archive on a non-seekable stream it
97 is necessary to supply the correct size when each entry is created.
99 \func{}{wxTarEntry
}{\param{const wxTarEntry\&
}{entry
}}
104 \membersection{wxTarEntry::Get/SetAccessTime
}\label{wxtarentryaccesstime
}
106 \constfunc{wxDateTime
}{GetAccessTime
}{\void}
108 \func{void
}{SetAccessTime
}{\param{const wxDateTime\&
}{dt
}}
110 The entry's access time stamp. See also
111 \helpref{wxArchiveEntry::Get/SetDateTime
}{wxarchiveentrydatetime
}.
114 \membersection{wxTarEntry::Get/SetCreateTime
}\label{wxtarentrycreatetime
}
116 \constfunc{wxDateTime
}{GetCreateTime
}{\void}
118 \func{void
}{SetCreateTime
}{\param{const wxDateTime\&
}{dt
}}
120 The entry's creation time stamp. See also
121 \helpref{wxArchiveEntry::Get/SetDateTime
}{wxarchiveentrydatetime
}.
124 \membersection{wxTarEntry::Get/SetDevMajor and Get/SetDevMinor
}\label{wxtarentrydev
}
126 \constfunc{int
}{GetDevMajor
}{\void}
128 \constfunc{int
}{GetDevMinor
}{\void}
130 \func{void
}{SetDevMajor
}{\param{int
}{dev
}}
132 \func{void
}{SetDevMinor
}{\param{int
}{dev
}}
134 OS specific IDs defining a device, these are only meaningful when
135 \helpref{TypeFlag
}{wxtarentrytypeflag
} is set to
{\it wxTAR
\_CHRTYPE}
136 or
{\it wxTAR
\_BLKTYPE}.
139 \membersection{wxTarEntry::Get/SetGroupId and Get/SetUserId
}\label{wxtarentryuidgid
}
141 \constfunc{int
}{GetGroupId
}{\void}
143 \constfunc{int
}{GetUserId
}{\void}
145 \func{void
}{SetGroupId
}{\param{int
}{id
}}
147 \func{void
}{SetUserId
}{\param{int
}{id
}}
149 The user ID and group ID that has
\helpref{permissions
}{wxtarentrymode
} over
150 this entry. These values aren't usually useful unless the file will only be
151 restored to the same system it originated from.
\helpref{Get/SetGroupName and
152 Get/SetUserName
}{wxtarentryunamegname
} can be used instead.
155 \membersection{wxTarEntry::Get/SetGroupName and Get/SetUserName
}\label{wxtarentryunamegname
}
157 \constfunc{wxString
}{GetGroupName
}{\void}
159 \constfunc{wxString
}{GetUserName
}{\void}
161 \func{void
}{SetGroupName
}{\param{const wxString\&
}{group
}}
163 \func{void
}{SetUserName
}{\param{const wxString\&
}{user
}}
165 The names of the user and group that has
\helpref{permissions
}{wxtarentrymode
}
166 over this entry. These are not present in very old tars.
169 \membersection{wxTarEntry::GetInternalName
}\label{wxtarentrygetinternalname
}
171 \constfunc{wxString
}{GetInternalName
}{\void}
173 Returns the entry's filename in the internal format used within the
174 archive. The name can include directory components, i.e. it can be a
177 The names of directory entries are returned without any trailing path
178 separator. This gives a canonical name that can be used in comparisons.
180 \func{wxString
}{GetInternalName
}{\param{const wxString\&
}{name
},
\param{wxPathFormat
}{format = wxPATH
\_NATIVE},
\param{bool*
}{pIsDir = NULL
}}
182 A static member that translates a filename into the internal format used
183 within the archive. If the third parameter is provided, the bool pointed
184 to is set to indicate whether the name looks like a directory name
185 (i.e. has a trailing path separator).
188 \membersection{wxTarEntry::Get/SetLinkName
}\label{wxtarentrylinkname
}
190 \constfunc{wxString
}{GetLinkName
}{\void}
192 \func{void
}{SetLinkName
}{\param{const wxString\&
}{link
}}
194 The filename of a previous entry in the tar that this entry is a link to.
195 Only meaningful when
\helpref{TypeFlag
}{wxtarentrytypeflag
} is set
196 to
{\it wxTAR
\_LNKTYPE} or
{\it wxTAR
\_SYMTYPE}.
199 \membersection{wxTarEntry::Get/SetMode
}\label{wxtarentrymode
}
201 \constfunc{int
}{GetMode
}{\void}
203 \func{void
}{SetMode
}{\param{int
}{mode
}}
205 UNIX permission bits for this entry. Giving read, write and execute permissions
206 to the file's
\helpref{User and Group
}{wxtarentryunamegname
} and to others.
207 Symbols are defined for them in <wx/file.h>.
210 #define wxS_IRUSR
00400
211 #define wxS_IWUSR
00200
212 #define wxS_IXUSR
00100
214 #define wxS_IRGRP
00040
215 #define wxS_IWGRP
00020
216 #define wxS_IXGRP
00010
218 #define wxS_IROTH
00004
219 #define wxS_IWOTH
00002
220 #define wxS_IXOTH
00001
225 \membersection{wxTarEntry::Get/SetSize
}\label{wxtarentrysize
}
227 \func{void
}{SetSize
}{\param{wxFileOffset
}{size
}}
229 \constfunc{wxFileOffset
}{GetSize
}{\void}
231 The size of the entry's data in bytes.
233 The tar archive format stores the entry's size ahead of the entry's data.
234 Therefore when creating an archive on a non-seekable stream it is necessary to
235 supply the correct size when each entry is created. For seekable streams this
236 is not necessary as
\helpref{wxTarOutputStream
}{wxtaroutputstream
} will attempt
237 to seek back and fix the entry's header when the entry is closed, though it is
238 still more efficient if the size is given beforehand.
241 \membersection{wxTarEntry::Get/SetTypeFlag
}\label{wxtarentrytypeflag
}
243 \constfunc{int
}{GetTypeFlag
}{\void}
245 \func{void
}{SetTypeFlag
}{\param{int
}{type
}}
247 Returns the type of the entry. It should be one of the following:
252 wxTAR_REGTYPE = '
0', // regular file
253 wxTAR_LNKTYPE = '
1', // hard link
254 wxTAR_SYMTYPE = '
2', // symbolic link
255 wxTAR_CHRTYPE = '
3', // character special
256 wxTAR_BLKTYPE = '
4', // block special
257 wxTAR_DIRTYPE = '
5', // directory
258 wxTAR_FIFOTYPE = '
6', // named pipe
259 wxTAR_CONTTYPE = '
7' // contiguous file
264 When creating archives use just these values. When reading archives
265 any other values should be treated as
{\it wxTAR
\_REGTYPE}.
268 \membersection{wxTarEntry::operator=
}\label{wxtarentryoperatorassign
}
270 \func{wxTarEntry\& operator
}{operator=
}{\param{const wxTarEntry\&
}{entry
}}
276 % automatically generated by HelpGen $Revision$ from
277 % wx/tarstrm.h at 28/Oct/06 18:27:02
280 \section{\class{wxTarInputStream
}}\label{wxtarinputstream
}
282 Input stream for reading tar files.
284 \helpref{GetNextEntry()
}{wxtarinputstreamgetnextentry
} returns an
285 \helpref{wxTarEntry
}{wxtarentry
} object containing the meta-data
286 for the next entry in the tar (and gives away ownership). Reading from
287 the wxTarInputStream then returns the entry's data. Eof() becomes true
288 after an attempt has been made to read past the end of the entry's data.
289 When there are no more entries, GetNextEntry() returns NULL and sets Eof().
291 Tar entries are seekable if the parent stream is seekable. In practice this
292 usually means they are only seekable if the tar is stored as a local file and
295 \wxheading{Derived from
}
297 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}\\
298 \helpref{wxFilterInputStream
}{wxfilterinputstream
}\\
299 \helpref{wxInputStream
}{wxinputstream
}\\
300 \helpref{wxStreamBase
}{wxstreambase
}
302 \wxheading{Include files
}
308 \helpref{wxBase
}{librarieslist
}
310 \wxheading{Data structures
}
312 typedef wxTarEntry entry_type
315 \helpref{Archive formats such as zip
}{wxarc
}\\
316 \helpref{wxTarEntry
}{wxtarentry
}\\
317 \helpref{wxTarOutputStream
}{wxtaroutputstream
}
319 \latexignore{\rtfignore{\wxheading{Members
}}}
322 \membersection{wxTarInputStream::wxTarInputStream
}\label{wxtarinputstreamwxtarinputstream
}
324 \func{}{wxTarInputStream
}{\param{wxInputStream\&
}{stream
},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
326 \func{}{wxTarInputStream
}{\param{wxInputStream*
}{stream
},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
328 Constructor. In a Unicode build the second parameter
{\it conv
} is
329 used to translate fields from the standard tar header into Unicode. It has
330 no effect on the stream's data.
{\it conv
} is only used for the standard
331 tar headers, any pax extended headers are always UTF-
8 encoded.
333 If the parent stream is passed as a pointer then the new filter stream
334 takes ownership of it. If it is passed by reference then it does not.
337 \membersection{wxTarInputStream::CloseEntry
}\label{wxtarinputstreamcloseentry
}
339 \func{bool
}{CloseEntry
}{\void}
341 Closes the current entry. On a non-seekable stream reads to the end of
342 the current entry first.
345 \membersection{wxTarInputStream::GetNextEntry
}\label{wxtarinputstreamgetnextentry
}
347 \func{wxTarEntry*
}{GetNextEntry
}{\void}
349 Closes the current entry if one is open, then reads the meta-data for
350 the next entry and returns it in a
\helpref{wxTarEntry
}{wxtarentry
}
351 object, giving away ownership. The stream is then open and can be read.
354 \membersection{wxTarInputStream::OpenEntry
}\label{wxtarinputstreamopenentry
}
356 \func{bool
}{OpenEntry
}{\param{wxTarEntry\&
}{entry
}}
358 Closes the current entry if one is open, then opens the entry specified
359 by the
{\it entry
} object.
361 {\it entry
} should be from the same tar file, and the tar should
362 be on a seekable stream.
366 \helpref{Looking up an archive entry by name
}{wxarcbyname
}
370 % automatically generated by HelpGen $Revision$ from
371 % wx/tarstrm.h at 28/Oct/06 18:27:02
374 \section{\class{wxTarOutputStream
}}\label{wxtaroutputstream
}
376 Output stream for writing tar files.
378 \helpref{PutNextEntry()
}{wxtaroutputstreamputnextentry
} is used to create
379 a new entry in the output tar, then the entry's data is written to the
380 wxTarOutputStream. Another call to PutNextEntry() closes the current
381 entry and begins the next.
383 \wxheading{Derived from
}
385 \helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}\\
386 \helpref{wxFilterOutputStream
}{wxfilteroutputstream
}\\
387 \helpref{wxOutputStream
}{wxoutputstream
}\\
388 \helpref{wxStreamBase
}{wxstreambase
}
390 \wxheading{Include files
}
396 \helpref{wxBase
}{librarieslist
}
398 \wxheading{Data structures
}
400 Constants for the
{\it format
} parameter of the
401 \helpref{constructor
}{wxtaroutputstreamwxtaroutputstream
}.
404 // Archive Formats (use wxTAR_PAX, it's backward compatible)
407 wxTAR_USTAR, // POSIX
.1-
1990 tar format
408 wxTAR_PAX // POSIX
.1-
2001 tar format
415 \helpref{Archive formats such as zip
}{wxarc
}\\
416 \helpref{wxTarEntry
}{wxtarentry
}\\
417 \helpref{wxTarInputStream
}{wxtarinputstream
}
420 \latexignore{\rtfignore{\wxheading{Members
}}}
423 \membersection{wxTarOutputStream::wxTarOutputStream
}\label{wxtaroutputstreamwxtaroutputstream
}
425 \func{}{wxTarOutputStream
}{\param{wxOutputStream\&
}{stream
},
\param{wxTarFormat
}{format = wxTAR
\_PAX},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
427 \func{}{wxTarOutputStream
}{\param{wxOutputStream*
}{stream
},
\param{wxTarFormat
}{format = wxTAR
\_PAX},
\param{wxMBConv\&
}{conv = wxConvLocal
}}
429 If the parent stream is passed as a pointer then the new filter stream
430 takes ownership of it. If it is passed by reference then it does not.
432 In a Unicode build the third parameter
{\it conv
} is used to translate the
433 headers fields into an
8-bit encoding. It has no effect on the stream's data.
435 When the
{\it format
} is
{\it wxTAR
\_PAX}, pax extended headers are generated
436 when any header field will not fit the standard tar header block or if it
437 uses any non-ascii characters.
439 Extended headers are stored as extra 'files' within the tar, and will be
440 extracted as such by any other tar program that does not understand them.
441 The
{\it conv
} parameter only affect the standard tar headers, the extended
442 headers are always UTF-
8 encoded.
444 When the
{\it format
} is
{\it wxTAR
\_USTAR}, no extended headers are
445 generated, and instead a warning message is logged if any header field
449 \membersection{wxTarOutputStream::
\destruct{wxTarOutputStream
}}\label{wxtaroutputstreamdtor
}
451 \func{}{\destruct{wxTarOutputStream
}}{\void}
453 The destructor calls
\helpref{Close()
}{wxtaroutputstreamclose
} to finish
454 writing the tar if it has not been called already.
457 \membersection{wxTarOutputStream::Close
}\label{wxtaroutputstreamclose
}
459 \func{bool
}{Close
}{\void}
461 Finishes writing the tar, returning true if successful.
462 Called by the destructor if not called explicitly.
465 \membersection{wxTarOutputStream::CloseEntry
}\label{wxtaroutputstreamcloseentry
}
467 \func{bool
}{CloseEntry
}{\void}
469 Close the current entry. It is called implicitly whenever another new
470 entry is created with
\helpref{CopyEntry()
}{wxtaroutputstreamcopyentry
}
471 or
\helpref{PutNextEntry()
}{wxtaroutputstreamputnextentry
}, or
472 when the tar is closed.
475 \membersection{wxTarOutputStream::CopyArchiveMetaData
}\label{wxtaroutputstreamcopyarchivemetadata
}
477 \func{bool
}{CopyArchiveMetaData
}{\param{wxTarInputStream\&
}{s
}}
479 See
\helpref{wxArchiveOutputStream::CopyArchiveMetaData
}{wxarchiveoutputstreamcopyarchivemetadata
}.
480 For the tar format this function does nothing.
483 \membersection{wxTarOutputStream::CopyEntry
}\label{wxtaroutputstreamcopyentry
}
485 \func{bool
}{CopyEntry
}{\param{wxTarEntry*
}{entry
},
\param{wxTarInputStream\&
}{inputStream
}}
487 Takes ownership of
{\it entry
} and uses it to create a new entry
488 in the tar.
{\it entry
} is then opened in
{\it inputStream
} and its contents
489 copied to this stream.
491 For some other archive formats CopyEntry() is much more efficient than
492 transferring the data using Read() and Write() since it will copy them
493 without decompressing and recompressing them. For tar however it makes
496 For tars on seekable streams,
{\it entry
} must be from the same tar file
497 as
{\it stream
}. For non-seekable streams,
{\it entry
} must also be the
498 last thing read from
{\it inputStream
}.
501 \membersection{wxTarOutputStream::Get/SetBlockingFactor
}\label{wxtaroutputstreamblockingfactor
}
503 \constfunc{int
}{GetBlockingFactor
}{\void}
505 \func{void
}{SetBlockingFactor
}{\param{int
}{factor
}}
507 The tar is zero padded to round its size up to
{\it BlockingFactor *
512} bytes.
509 Defaults to
10 for
{\it wxTAR
\_PAX} and
20 for
{\it wxTAR
\_USTAR}
510 (see the
\helpref{constructor
}{wxtaroutputstreamwxtaroutputstream
}), as
511 specified in the POSIX standards.
514 \membersection{wxTarOutputStream::PutNextDirEntry
}\label{wxtaroutputstreamputnextdirentry
}
516 \func{bool
}{PutNextDirEntry
}{\param{const wxString\&
}{name
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
}}
518 Create a new directory entry
519 (see
\helpref{wxArchiveEntry::IsDir()
}{wxarchiveentryisdir
})
520 with the given name and timestamp.
522 \helpref{PutNextEntry()
}{wxtaroutputstreamputnextentry
} can
523 also be used to create directory entries, by supplying a name with
524 a trailing path separator.
527 \membersection{wxTarOutputStream::PutNextEntry
}\label{wxtaroutputstreamputnextentry
}
529 \func{bool
}{PutNextEntry
}{\param{wxTarEntry*
}{entry
}}
531 Takes ownership of
{\it entry
} and uses it to create a new entry
534 \func{bool
}{PutNextEntry
}{\param{const wxString\&
}{name
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
},
\param{wxFileOffset
}{size = wxInvalidOffset
}}
536 Create a new entry with the given name, timestamp and size.