ckb-next
v0.2.8 at branch master
ckb-next driver for corsair devices
|
GZIP file. More...
#include <src/ckb/quazip/quagzipfile.h>
Public Member Functions | |
QuaGzipFile () | |
Empty constructor. More... | |
QuaGzipFile (QObject *parent) | |
Empty constructor with a parent. More... | |
QuaGzipFile (const QString &fileName, QObject *parent=NULL) | |
Constructor. More... | |
virtual | ~QuaGzipFile () |
Destructor. More... | |
void | setFileName (const QString &fileName) |
Sets the name of the GZIP file to be opened. More... | |
QString | getFileName () const |
Returns the name of the GZIP file. More... | |
virtual bool | isSequential () const |
Returns true. More... | |
virtual bool | open (QIODevice::OpenMode mode) |
Opens the file. More... | |
virtual bool | open (int fd, QIODevice::OpenMode mode) |
Opens the file. More... | |
virtual bool | flush () |
Flushes data to file. More... | |
virtual void | close () |
Closes the file. More... | |
Protected Member Functions | |
virtual qint64 | readData (char *data, qint64 maxSize) |
Implementation of QIODevice::readData(). More... | |
virtual qint64 | writeData (const char *data, qint64 maxSize) |
Implementation of QIODevice::writeData(). More... | |
Private Member Functions | |
QuaGzipFile (const QuaGzipFile &that) | |
QuaGzipFile & | operator= (const QuaGzipFile &that) |
Private Attributes | |
QuaGzipFilePrivate * | d |
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.
Definition at line 39 of file quagzipfile.h.
QuaGzipFile::QuaGzipFile | ( | ) |
QuaGzipFile::QuaGzipFile | ( | QObject * | parent | ) |
Must call setFileName() before trying to open.
parent | The parent object, as per QObject logic. |
Definition at line 92 of file quagzipfile.cpp.
QuaGzipFile::QuaGzipFile | ( | const QString & | fileName, |
QObject * | parent = NULL |
||
) |
fileName | The name of the GZIP file. |
parent | The parent object, as per QObject logic. |
Definition at line 98 of file quagzipfile.cpp.
|
virtual |
|
private |
|
virtual |
Definition at line 152 of file quagzipfile.cpp.
References d.
Referenced by ~QuaGzipFile().
|
virtual |
The data is written using Z_SYNC_FLUSH mode. Doesn't make any sense when reading.
Definition at line 147 of file quagzipfile.cpp.
References d.
QString QuaGzipFile::getFileName | ( | ) | const |
|
virtual |
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.
Definition at line 122 of file quagzipfile.cpp.
|
virtual |
mode | Can be either QIODevice::Write or QIODevice::Read. ReadWrite and Append aren't supported. |
Definition at line 127 of file quagzipfile.cpp.
References d.
|
virtual |
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. |
Definition at line 137 of file quagzipfile.cpp.
References d.
|
private |
|
protectedvirtual |
void QuaGzipFile::setFileName | ( | const QString & | fileName | ) |
|
protectedvirtual |
|
private |
Definition at line 105 of file quagzipfile.h.
Referenced by close(), flush(), getFileName(), open(), readData(), setFileName(), writeData(), and ~QuaGzipFile().