|
Canorus 0.0
|
Class for the manipulation of a gzipped tar archive (tar.gz) More...
#include <archive.h>
Public Member Functions | |
| CAArchive () | |
| CAArchive (QIODevice &arch) | |
| qint64 | write (QIODevice &dest) |
| virtual | ~CAArchive () |
| bool | addFile (const QString &filename, QIODevice &data) |
| bool | addFile (const QString &filename, QByteArray data) |
| void | removeFile (const QString &filename) |
| CAIOPtr | file (const QString &filename) |
| bool | error () |
| const QString & | version () |
Protected Member Functions | |
| void | parse (QIODevice &) |
| int | getOS () |
Protected Attributes | |
| QString | _version |
| bool | _err |
| CATar * | _tar |
Static Protected Attributes | |
| static const int | CHUNK = 16384 |
| static const QString | COMMENT = "Canorus Archive v"+QString(CANORUS_VERSION).remove(QRegExp("[a-z]*$")) |
Class for the manipulation of a gzipped tar archive (tar.gz)
Copyright (c) 2007, Itay Perl, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.
This class allows read/write operations on tar.gz archives.
See RFC 1952 for the GZIP specification.
| CAArchive::CAArchive | ( | ) |
Creates and empty archive
References _tar.
| CAArchive::CAArchive | ( | QIODevice & | arch | ) |
|
virtual |
Destory the archive
References _tar.
|
inline |
|
inline |
References _tar, CATar::addFile(), and error().
Referenced by CACanExport::exportDocumentImpl().


|
inline |
References _err, _tar, and CATar::error().
Referenced by addFile(), file(), CACanImport::importDocumentImpl(), removeFile(), and write().


References _tar, error(), and CATar::file().
Referenced by CACanImport::importDocumentImpl().


|
protected |
|
protected |
Parse/decompress an existing archive
References _err, _tar, _version, z_stream_s::avail_in, z_stream_s::avail_out, CHUNK, gz_header_s::comm_max, gz_header_s::comment, getOS(), inflate, inflateEnd, inflateInit2, z_stream_s::next_in, z_stream_s::next_out, z_stream_s::opaque, gz_header_s::os, Z_BUF_ERROR, Z_NO_FLUSH, Z_NULL, Z_OK, Z_STREAM_END, z_stream_s::zalloc, and z_stream_s::zfree.
Referenced by CAArchive().


|
inline |
| qint64 CAArchive::write | ( | QIODevice & | dest | ) |
Write the tar.gz archive into the given device. Returns the number of byte written, or -1 on error.
References _err, _tar, z_stream_s::avail_in, z_stream_s::avail_out, CHUNK, CATar::close(), COMMENT, gz_header_s::comment, deflate, deflateEnd, deflateInit2, CATar::eof(), error(), getOS(), z_stream_s::next_in, z_stream_s::next_out, z_stream_s::opaque, CATar::open(), gz_header_s::os, CATar::write(), Z_DEFAULT_COMPRESSION, Z_DEFAULT_STRATEGY, Z_DEFLATED, Z_FINISH, Z_NO_FLUSH, Z_NULL, Z_OK, Z_STREAM_END, Z_STREAM_ERROR, z_stream_s::zalloc, and z_stream_s::zfree.
Referenced by CACanExport::exportDocumentImpl().


|
protected |
Referenced by addFile(), CAArchive(), error(), file(), parse(), removeFile(), write(), and ~CAArchive().
|
staticprotected |
Referenced by write().