![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qdecompresshelper_p.h>
Public Types | |
enum | ContentEncoding { None , Deflate , GZip , Brotli , Zstandard } |
Public Member Functions | |
QDecompressHelper ()=default | |
Q_NETWORK_EXPORT | ~QDecompressHelper () |
Q_NETWORK_EXPORT bool | setEncoding (QByteArrayView contentEncoding) |
Q_NETWORK_EXPORT bool | isCountingBytes () const |
Q_NETWORK_EXPORT void | setCountingBytesEnabled (bool shouldCount) |
Q_NETWORK_EXPORT qint64 | uncompressedSize () const |
Q_NETWORK_EXPORT bool | hasData () const |
Q_NETWORK_EXPORT void | feed (const QByteArray &data) |
Q_NETWORK_EXPORT void | feed (QByteArray &&data) |
Q_NETWORK_EXPORT void | feed (const QByteDataBuffer &buffer) |
Q_NETWORK_EXPORT void | feed (QByteDataBuffer &&buffer) |
Q_NETWORK_EXPORT qsizetype | read (char *data, qsizetype maxSize) |
Q_NETWORK_EXPORT bool | isValid () const |
Q_NETWORK_EXPORT void | clear () |
Q_NETWORK_EXPORT void | setDecompressedSafetyCheckThreshold (qint64 threshold) |
Q_NETWORK_EXPORT QString | errorString () const |
Static Public Member Functions | |
static Q_NETWORK_EXPORT bool | isSupportedEncoding (QByteArrayView encoding) |
static Q_NETWORK_EXPORT QByteArrayList | acceptedEncoding () |
Definition at line 27 of file qdecompresshelper_p.h.
Enumerator | |
---|---|
None | |
Deflate | |
GZip | |
Brotli | |
Zstandard |
Definition at line 30 of file qdecompresshelper_p.h.
|
default |
QDecompressHelper::~QDecompressHelper | ( | ) |
Definition at line 89 of file qdecompresshelper.cpp.
|
static |
Definition at line 79 of file qdecompresshelper.cpp.
void QDecompressHelper::clear | ( | ) |
QString QDecompressHelper::errorString | ( | ) | const |
Returns a string describing the error that occurred or an empty string if no error occurred.
Definition at line 521 of file qdecompresshelper.cpp.
void QDecompressHelper::feed | ( | const QByteArray & | data | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 222 of file qdecompresshelper.cpp.
void QDecompressHelper::feed | ( | const QByteDataBuffer & | buffer | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 252 of file qdecompresshelper.cpp.
References None.
void QDecompressHelper::feed | ( | QByteArray && | data | ) |
Give data to the QDecompressHelper which will be stored until a read is attempted.
If isCountingBytes()
is true then it will decompress immediately before discarding the data, but will count the uncompressed byte size.
Definition at line 236 of file qdecompresshelper.cpp.
References None.
void QDecompressHelper::feed | ( | QByteDataBuffer && | buffer | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 268 of file qdecompresshelper.cpp.
References None.
bool QDecompressHelper::hasData | ( | ) | const |
Returns true if there are encoded bytes left or there is some indication that the decoder still has data left internally.
Definition at line 483 of file qdecompresshelper.cpp.
bool QDecompressHelper::isCountingBytes | ( | ) | const |
Returns true if the QDecompressHelper is measuring the size of the decompressed data.
Definition at line 166 of file qdecompresshelper.cpp.
|
static |
Definition at line 74 of file qdecompresshelper.cpp.
bool QDecompressHelper::isValid | ( | ) | const |
Returns whether or not the object is valid. If it becomes invalid after an operation has been performed then an error has occurred.
Definition at line 510 of file qdecompresshelper.cpp.
References None.
Definition at line 356 of file qdecompresshelper.cpp.
void QDecompressHelper::setCountingBytesEnabled | ( | bool | shouldCount | ) |
Enable or disable counting the decompressed size of the data based on shouldCount. Enabling this means the data will be decompressed twice (once for counting and once when data is being read).
Definition at line 184 of file qdecompresshelper.cpp.
References None.
Set the threshold required before the archive bomb detection kicks in. By default this is 10MB. Setting it to -1 is treated as disabling the feature.
Definition at line 433 of file qdecompresshelper.cpp.
bool QDecompressHelper::setEncoding | ( | QByteArrayView | contentEncoding | ) |
Definition at line 94 of file qdecompresshelper.cpp.
References None.
qint64 QDecompressHelper::uncompressedSize | ( | ) | const |
Returns the amount of uncompressed bytes left.
Definition at line 206 of file qdecompresshelper.cpp.