Vidalia
0.3.1
|
#include <ZlibByteArray.h>
Public Types | |
enum | CompressionMethod { None, Gzip, Zlib } |
Public Member Functions | |
ZlibByteArray (QByteArray data) | |
QByteArray | compress (const CompressionMethod method=Zlib, QString *errmsg=0) const |
QByteArray | uncompress (CompressionMethod method=Zlib, QString *errmsg=0) const |
Static Public Member Functions | |
static QByteArray | compress (const QByteArray in, const CompressionMethod method=Zlib, QString *errmsg=0) |
static QByteArray | uncompress (const QByteArray in, const CompressionMethod method=Zlib, QString *errmsg=0) |
static bool | isZlibAvailable () |
static bool | isGzipSupported () |
Static Private Member Functions | |
static int | methodBits (CompressionMethod method) |
static QString | methodString (CompressionMethod method) |
Definition at line 59 of file ZlibByteArray.h.
Available compression methods.
Enumerator | |
---|---|
None |
No compression method. |
Gzip |
Gzip compression method. |
Zlib |
Zlib compression method. |
Definition at line 63 of file ZlibByteArray.h.
ZlibByteArray::ZlibByteArray | ( | QByteArray | data | ) |
QByteArray ZlibByteArray::compress | ( | const CompressionMethod | method = Zlib , |
QString * | errmsg = 0 |
||
) | const |
Compresses the current contents of this object using method.
Compresses the current contents of this object using method. Returns the compressed data if successful. If an error occurs, this will return an empty QByteArray and set the optional errmsg to a string describing the failure.
Definition at line 154 of file ZlibByteArray.cpp.
|
static |
Compreses the contents of in using method.
Compresses in using method. Returns the compressed data if successful. If an error occurs, this will return an empty QByteArray and set the optional errmsg to a string describing the failure.
Definition at line 164 of file ZlibByteArray.cpp.
References err(), Gzip, isGzipSupported(), methodBits(), methodString(), and None.
|
static |
Returns true iff we support gzip-based compression. Otherwise, we need to use zlib.
Definition at line 132 of file ZlibByteArray.cpp.
Referenced by compress(), and uncompress().
|
static |
Returns true if the Zlib compression library is available and usable.
Definition at line 108 of file ZlibByteArray.cpp.
|
staticprivate |
Return the 'bits' value to tell zlib to use method.
Definition at line 88 of file ZlibByteArray.cpp.
References Gzip.
Referenced by compress(), and uncompress().
|
staticprivate |
Returns a string description of method.
Definition at line 96 of file ZlibByteArray.cpp.
References Gzip, None, and Zlib.
Referenced by compress(), and uncompress().
QByteArray ZlibByteArray::uncompress | ( | CompressionMethod | method = Zlib , |
QString * | errmsg = 0 |
||
) | const |
Uncompresses the current contents of this object using method.
Uncompresses the current contents of this object using method. Returns the uncompressed data if successful. If an error occurs, this will return an empty QByteArray and set the optional errmsg to a string describing the failure.
Definition at line 261 of file ZlibByteArray.cpp.
|
static |
Uncompresses the contents of in using method.
Uncompresses in using method. Returns the uncompressed data if successful. If an error occurs, this will return an empty QByteArray and set the optional errmsg to a string describing the failure.
Definition at line 271 of file ZlibByteArray.cpp.
References err(), Gzip, isGzipSupported(), methodBits(), methodString(), and None.