5#ifndef QNETWORKDISKCACHE_P_H
6#define QNETWORKDISKCACHE_P_H
19#include <QtNetwork/private/qtnetworkglobal_p.h>
20#include "private/qabstractnetworkcache_p.h"
33 QCacheItem() =
default;
39 QNetworkCacheMetaData metaData;
41 QSaveFile *file =
nullptr;
42 inline qint64 size()
const
43 {
return file ? file->size() : data.size(); }
46 metaData = QNetworkCacheMetaData();
51 void writeHeader(QFileDevice *device)
const;
52 void writeCompressedData(QFileDevice *device)
const;
53 bool read(QFileDevice *device,
bool readData);
55 bool canCompress()
const;
81 Q_DECLARE_PUBLIC(QNetworkDiskCache)
QNetworkDiskCachePrivate()
bool removeFile(const QString &file)
Put all of the misc file removing into one function to be extra safe.
QString cacheFileName(const QUrl &url) const
Generates fully qualified path of cached resource from a URL.
static QString uniqueFileName(const QUrl &url)
Given a URL, generates a unique enough filename (and subdirectory)
void prepareLayout()
Create subdirectories and other housekeeping on the filesystem.
QHash< QIODevice *, QCacheItem * > inserting
static quint32 crc32(const char *data, uint len)
void storeItem(QCacheItem *item)
The QNetworkDiskCache class provides a very basic disk cache.
QT_REQUIRE_CONFIG(animation)
#define MAX_COMPRESSION_SIZE
QT_REQUIRE_CONFIG(networkdiskcache)