Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QCacheItem Class Reference

#include <qnetworkdiskcache_p.h>

+ Collaboration diagram for QCacheItem:

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
 
QSaveFilefile = nullptr
 

Detailed Description

Definition at line 29 of file qnetworkdiskcache_p.h.

Constructor & Destructor Documentation

◆ QCacheItem()

QCacheItem::QCacheItem ( )
default

◆ ~QCacheItem()

QCacheItem::~QCacheItem ( )
inline

Definition at line 33 of file qnetworkdiskcache_p.h.

References reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ canCompress()

bool QCacheItem::canCompress ( ) const

We compress small text and JavaScript files.

Definition at line 583 of file qnetworkdiskcache.cpp.

References Qt::CaseInsensitive, QString::compare(), QString::first(), header(), MAX_COMPRESSION_SIZE, metaData, QNetworkCacheMetaData::rawHeaders(), and QString::toLongLong().

Referenced by writeHeader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

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 641 of file qnetworkdiskcache.cpp.

References CacheMagic, compressed, CurrentCacheVersion, device, QList< T >::isEmpty(), QNetworkCacheMetaData::isValid(), metaData, qUncompress(), QNetworkCacheMetaData::rawHeaders(), readData(), QIODeviceBase::ReadOnly, reset(), QNetworkDiskCachePrivate::uniqueFileName(), and QNetworkCacheMetaData::url().

+ Here is the call graph for this function:

◆ reset()

void QCacheItem::reset ( )
inline

Definition at line 44 of file qnetworkdiskcache_p.h.

References file, and metaData.

Referenced by ~QCacheItem(), read(), and QNetworkDiskCachePrivate::storeItem().

+ Here is the caller graph for this function:

◆ size()

qint64 QCacheItem::size ( ) const
inline

Definition at line 41 of file qnetworkdiskcache_p.h.

References file, and QFileDevice::size().

+ Here is the call graph for this function:

◆ writeCompressedData()

void QCacheItem::writeCompressedData ( QFileDevice device) const

Definition at line 630 of file qnetworkdiskcache.cpp.

References device, out, and qCompress().

Referenced by QNetworkDiskCachePrivate::storeItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeHeader()

void QCacheItem::writeHeader ( QFileDevice device) const

Definition at line 618 of file qnetworkdiskcache.cpp.

References CacheMagic, canCompress(), compressed, CurrentCacheVersion, device, metaData, and out.

Referenced by QNetworkDiskCachePrivate::storeItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ data

QBuffer QCacheItem::data

Definition at line 39 of file qnetworkdiskcache_p.h.

Referenced by QNetworkDiskCachePrivate::storeItem().

◆ file

QSaveFile* QCacheItem::file = nullptr

Definition at line 40 of file qnetworkdiskcache_p.h.

Referenced by reset(), size(), and QNetworkDiskCachePrivate::storeItem().

◆ metaData

QNetworkCacheMetaData QCacheItem::metaData

The documentation for this class was generated from the following files: