#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 () |
Protected Member Functions | |
| void | parse (QIODevice &) |
| int | getOS () |
Protected Attributes | |
| bool | _err |
| CATar * | _tar |
Static Protected Attributes | |
| static const int | CHUNK = 16384 |
| static const char * | VERSION = "Canorus Archive v0.5" |
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.
Definition at line 17 of file archive.h.
| CAArchive::CAArchive | ( | ) |
| CAArchive::CAArchive | ( | QIODevice & | arch | ) |
Read an existing archive.
Definition at line 45 of file archive.cpp.
References parse().

| CAArchive::~CAArchive | ( | ) | [virtual] |
| qint64 CAArchive::write | ( | QIODevice & | dest | ) |
Write the tar.gz archive into the given device. Returns the number of byte written, or -1 on error.
Definition at line 145 of file archive.cpp.
References _err, _tar, z_stream_s::avail_in, z_stream_s::avail_out, CHUNK, gz_header_s::comment, deflateInit2, CATar::eof(), error(), getOS(), z_stream_s::next_in, z_stream_s::next_out, z_stream_s::opaque, gz_header_s::os, VERSION, 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().


| bool CAArchive::addFile | ( | const QString & | filename, | |
| QIODevice & | data | |||
| ) | [inline] |
Definition at line 25 of file archive.h.
References _tar, CATar::addFile(), and error().
Referenced by CACanExport::exportDocumentImpl().


| bool CAArchive::addFile | ( | const QString & | filename, | |
| QByteArray | data | |||
| ) | [inline] |
Definition at line 26 of file archive.h.
References _tar, CATar::addFile(), and error().

| void CAArchive::removeFile | ( | const QString & | filename | ) | [inline] |
Definition at line 27 of file archive.h.
References _tar, error(), and CATar::removeFile().

| CAIOPtr CAArchive::file | ( | const QString & | filename | ) | [inline] |
Definition at line 28 of file archive.h.
References _tar, error(), and CATar::file().
Referenced by CACanImport::importDocumentImpl().


| bool CAArchive::error | ( | ) | [inline] |
Definition at line 29 of file archive.h.
References _err, _tar, and CATar::error().
Referenced by addFile(), file(), CACanImport::importDocumentImpl(), removeFile(), and write().


| void CAArchive::parse | ( | QIODevice & | arch | ) | [protected] |
Parse/decompress an existing archive
Definition at line 62 of file archive.cpp.
References _err, _tar, z_stream_s::avail_in, z_stream_s::avail_out, CHUNK, gz_header_s::comm_max, gz_header_s::comment, getOS(), 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().


| int CAArchive::getOS | ( | ) | [protected] |
Return an operating system ID for use in a GZip header. See RFC 1952.
Definition at line 238 of file archive.cpp.
Referenced by parse(), and write().

const int CAArchive::CHUNK = 16384 [static, protected] |
const char * CAArchive::VERSION = "Canorus Archive v0.5" [static, protected] |
bool CAArchive::_err [protected] |
CATar* CAArchive::_tar [protected] |
Definition at line 37 of file archive.h.
Referenced by addFile(), CAArchive(), error(), file(), parse(), removeFile(), write(), and ~CAArchive().
1.5.3