#include </home/zeitlin/src/wx/github/interface/wx/tarstrm.h>
Input stream for reading tar files.
wxTarInputStream::GetNextEntry() returns a wxTarEntry object containing the meta-data for the next entry in the tar (and gives away ownership). Reading from the wxTarInputStream then returns the entry's data. wxTarInputStream::Eof() becomes true after an attempt has been made to read past the end of the entry's data.
When there are no more entries, wxTarInputStream::GetNextEntry() returns NULL and sets wxTarInputStream::Eof().
Tar entries are seekable if the parent stream is seekable. In practice this usually means they are only seekable if the tar is stored as a local file and is not compressed.
Public Member Functions | |
bool | CloseEntry () |
Closes the current entry. | |
wxTarEntry * | GetNextEntry () |
Closes the current entry if one is open, then reads the meta-data for the next entry and returns it in a wxTarEntry object, giving away ownership. | |
bool | OpenEntry (wxTarEntry &entry) |
Closes the current entry if one is open, then opens the entry specified by the entry object. | |
wxTarInputStream (wxInputStream &stream, wxMBConv &conv=wxConvLocal) | |
Constructor. | |
wxTarInputStream (wxInputStream *stream, wxMBConv &conv=wxConvLocal) | |
Constructor. |
wxTarInputStream::wxTarInputStream | ( | wxInputStream & | stream, |
wxMBConv & | conv = wxConvLocal |
||
) |
Constructor.
In a Unicode build the second parameter conv is used to translate fields from the standard tar header into Unicode.
It has no effect on the stream's data. conv is only used for the standard tar headers, any pax extended headers are always UTF-8 encoded.
If the parent stream is passed as a pointer then the new filter stream takes ownership of it. If it is passed by reference then it does not.
wxTarInputStream::wxTarInputStream | ( | wxInputStream * | stream, |
wxMBConv & | conv = wxConvLocal |
||
) |
Constructor.
In a Unicode build the second parameter conv is used to translate fields from the standard tar header into Unicode.
It has no effect on the stream's data. conv is only used for the standard tar headers, any pax extended headers are always UTF-8 encoded.
If the parent stream is passed as a pointer then the new filter stream takes ownership of it. If it is passed by reference then it does not.
bool wxTarInputStream::CloseEntry | ( | ) | [virtual] |
Closes the current entry.
On a non-seekable stream reads to the end of the current entry first.
Implements wxArchiveInputStream.
wxTarEntry* wxTarInputStream::GetNextEntry | ( | ) |
Closes the current entry if one is open, then reads the meta-data for the next entry and returns it in a wxTarEntry object, giving away ownership.
The stream is then open and can be read.
Reimplemented from wxArchiveInputStream.
bool wxTarInputStream::OpenEntry | ( | wxTarEntry & | entry | ) |
Closes the current entry if one is open, then opens the entry specified by the entry object.
entry should be from the same tar file, and the tar should be on a seekable stream.