Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qnetworkdiskcache_p.h>
Public Member Functions | |
QCacheItem ()=default | |
~QCacheItem () | |
qint64 | size () const |
void | reset () |
void | writeHeader (QFileDevice *device) const |
void | writeCompressedData (QFileDevice *device) const |
bool | read (QFileDevice *device, bool readData) |
Returns false if the file is a cache file, but is an older version and should be removed otherwise true. | |
bool | canCompress () const |
We compress small text and JavaScript files. | |
Public Attributes | |
QNetworkCacheMetaData | metaData |
QBuffer | data |
QSaveFile * | file = nullptr |
Definition at line 29 of file qnetworkdiskcache_p.h.
|
default |
|
inline |
Definition at line 33 of file qnetworkdiskcache_p.h.
References reset().
bool QCacheItem::canCompress | ( | ) | const |
We compress small text and JavaScript files.
Definition at line 575 of file qnetworkdiskcache.cpp.
References QHttpHeaders::ContentLength, QHttpHeaders::ContentType, QNetworkCacheMetaData::headers(), MAX_COMPRESSION_SIZE, metaData, and QHttpHeaders::value().
Referenced by writeHeader().
bool QCacheItem::read | ( | QFileDevice * | device, |
bool | readData ) |
Returns false
if the file is a cache file, but is an older version and should be removed otherwise true.
Definition at line 629 of file qnetworkdiskcache.cpp.
References CacheMagic, compressed, CurrentCacheVersion, device, QNetworkCacheMetaData::headers(), QHttpHeaders::isEmpty(), QNetworkCacheMetaData::isValid(), metaData, qUncompress(), readData(), QIODeviceBase::ReadOnly, reset(), QNetworkDiskCachePrivate::uniqueFileName(), and QNetworkCacheMetaData::url().
|
inline |
Definition at line 44 of file qnetworkdiskcache_p.h.
References file, and metaData.
Referenced by ~QCacheItem(), read(), and QNetworkDiskCachePrivate::storeItem().
|
inline |
Definition at line 41 of file qnetworkdiskcache_p.h.
References file.
void QCacheItem::writeCompressedData | ( | QFileDevice * | device | ) | const |
Definition at line 618 of file qnetworkdiskcache.cpp.
References device, out, and qCompress().
void QCacheItem::writeHeader | ( | QFileDevice * | device | ) | const |
Definition at line 606 of file qnetworkdiskcache.cpp.
References CacheMagic, canCompress(), compressed, CurrentCacheVersion, device, metaData, and out.
QBuffer QCacheItem::data |
Definition at line 39 of file qnetworkdiskcache_p.h.
QSaveFile* QCacheItem::file = nullptr |
Definition at line 40 of file qnetworkdiskcache_p.h.
QNetworkCacheMetaData QCacheItem::metaData |
Definition at line 38 of file qnetworkdiskcache_p.h.
Referenced by canCompress(), read(), reset(), QNetworkDiskCachePrivate::storeItem(), and writeHeader().