QuaZip quazip-1-4
|
GZIP file. More...
#include <quagzipfile.h>
Public Member Functions | |
QuaGzipFile () | |
Empty constructor. | |
QuaGzipFile (QObject *parent) | |
Empty constructor with a parent. | |
QuaGzipFile (const QString &fileName, QObject *parent=nullptr) | |
Constructor. | |
~QuaGzipFile () override | |
Destructor. | |
void | setFileName (const QString &fileName) |
Sets the name of the GZIP file to be opened. | |
QString | getFileName () const |
Returns the name of the GZIP file. | |
bool | isSequential () const override |
Returns true. | |
bool | open (QIODevice::OpenMode mode) override |
Opens the file. | |
virtual bool | open (int fd, QIODevice::OpenMode mode) |
Opens the file. | |
virtual bool | flush () |
Flushes data to file. | |
void | close () override |
Closes the file. | |
Public Member Functions inherited from QIODevice | |
virtual const QMetaObject * | metaObject () const const |
virtual void * | qt_metacast (const char *) |
virtual int | qt_metacall (QMetaObject::Call, int, void **) |
QIODevice (QObject *parent) | |
QIODevice::OpenMode | openMode () const const |
void | setTextModeEnabled (bool enabled) |
bool | isTextModeEnabled () const const |
bool | isOpen () const const |
bool | isReadable () const const |
bool | isWritable () const const |
virtual bool | isSequential () const const |
int | readChannelCount () const const |
int | writeChannelCount () const const |
int | currentReadChannel () const const |
void | setCurrentReadChannel (int channel) |
int | currentWriteChannel () const const |
void | setCurrentWriteChannel (int channel) |
virtual bool | open (QIODevice::OpenMode mode) |
virtual void | close () |
virtual qint64 | pos () const const |
virtual qint64 | size () const const |
virtual bool | seek (qint64 pos) |
virtual bool | atEnd () const const |
virtual bool | reset () |
virtual qint64 | bytesAvailable () const const |
virtual qint64 | bytesToWrite () const const |
qint64 | read (char *data, qint64 maxSize) |
QByteArray | read (qint64 maxSize) |
QByteArray | readAll () |
qint64 | readLine (char *data, qint64 maxSize) |
QByteArray | readLine (qint64 maxSize) |
virtual bool | canReadLine () const const |
void | startTransaction () |
void | commitTransaction () |
void | rollbackTransaction () |
bool | isTransactionStarted () const const |
qint64 | write (const char *data, qint64 maxSize) |
qint64 | write (const char *data) |
qint64 | write (const QByteArray &byteArray) |
qint64 | peek (char *data, qint64 maxSize) |
QByteArray | peek (qint64 maxSize) |
qint64 | skip (qint64 maxSize) |
virtual bool | waitForReadyRead (int msecs) |
virtual bool | waitForBytesWritten (int msecs) |
void | ungetChar (char c) |
bool | putChar (char c) |
bool | getChar (char *c) |
QString | errorString () const const |
void | readyRead () |
void | channelReadyRead (int channel) |
void | bytesWritten (qint64 bytes) |
void | channelBytesWritten (int channel, qint64 bytes) |
void | aboutToClose () |
void | readChannelFinished () |
Public Member Functions inherited from QObject | |
virtual const QMetaObject * | metaObject () const const |
virtual void * | qt_metacast (const char *) |
virtual int | qt_metacall (QMetaObject::Call, int, void **) |
QObject (QObject *parent) | |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
QString | objectName () const const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
bool | signalsBlocked () const const |
bool | blockSignals (bool block) |
QThread * | thread () const const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () const const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectInfo () const const |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const const |
QList< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Protected Member Functions | |
qint64 | readData (char *data, qint64 maxSize) override |
Implementation of QIODevice::readData(). | |
qint64 | writeData (const char *data, qint64 maxSize) override |
Implementation of QIODevice::writeData(). | |
Protected Member Functions inherited from QIODevice | |
virtual qint64 | readData (char *data, qint64 maxSize)=0 |
virtual qint64 | readLineData (char *data, qint64 maxSize) |
virtual qint64 | writeData (const char *data, qint64 maxSize)=0 |
void | setOpenMode (QIODevice::OpenMode openMode) |
void | setErrorString (const QString &str) |
Protected Member Functions inherited from QObject | |
QObject * | sender () const const |
int | senderSignalIndex () const const |
int | receivers (const char *signal) const const |
bool | isSignalConnected (const QMetaMethod &signal) const const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
Additional Inherited Members | |
Static Public Member Functions inherited from QIODevice | |
QString | tr (const char *s, const char *c, int n) |
QString | trUtf8 (const char *s, const char *c, int n) |
Static Public Member Functions inherited from QObject | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
Public Attributes inherited from QIODevice | |
typedef | OpenMode |
Properties inherited from QObject | |
objectName | |
GZIP file.
This class is a wrapper around GZIP file access functions in zlib. Unlike QuaZip classes, it doesn't allow reading from a GZIP file opened as QIODevice, for example, if your GZIP file is in QBuffer. It only provides QIODevice access to a GZIP file contents, but the GZIP file itself must be identified by its name on disk or by descriptor id.
QuaGzipFile::QuaGzipFile | ( | ) |
Empty constructor.
Must call setFileName() before trying to open.
QuaGzipFile::QuaGzipFile | ( | QObject * | parent | ) |
Empty constructor with a parent.
Must call setFileName() before trying to open.
parent | The parent object, as per QObject logic. |
Constructor.
fileName | The name of the GZIP file. |
parent | The parent object, as per QObject logic. |
|
overridevirtual |
Returns true.
Strictly speaking, zlib supports seeking for GZIP files, but it is poorly implemented, because there is no way to implement it properly. For reading, seeking backwards is very slow, and for writing, it is downright impossible. Therefore, QuaGzipFile does not support seeking at all.
Reimplemented from QIODevice.
|
overridevirtual |
Opens the file.
mode | Can be either QIODevice::Write or QIODevice::Read. ReadWrite and Append aren't supported. |
Reimplemented from QIODevice.
References QIODevice::open(), and QIODevice::setErrorString().
|
virtual |
Opens the file.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
fd | The file descriptor to read/write the GZIP file from/to. |
mode | Can be either QIODevice::Write or QIODevice::Read. ReadWrite and Append aren't supported. |
References QIODevice::open(), and QIODevice::setErrorString().
|
virtual |
Flushes data to file.
The data is written using Z_SYNC_FLUSH mode. Doesn't make any sense when reading.
|
overridevirtual |
Closes the file.
Reimplemented from QIODevice.
References QIODevice::close().
Referenced by ~QuaGzipFile().
|
overrideprotectedvirtual |
Implementation of QIODevice::readData().
Implements QIODevice.
|
overrideprotectedvirtual |
Implementation of QIODevice::writeData().
Implements QIODevice.