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>.
Loading...
Searching...
No Matches
qnetworkdiskcache.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QNETWORKDISKCACHE_H
5#define QNETWORKDISKCACHE_H
6
7#include <QtNetwork/qtnetworkglobal.h>
8#include <QtNetwork/qabstractnetworkcache.h>
9
10QT_REQUIRE_CONFIG(networkdiskcache);
11
13
15class Q_NETWORK_EXPORT QNetworkDiskCache : public QAbstractNetworkCache
16{
18
19public:
20 explicit QNetworkDiskCache(QObject *parent = nullptr);
22
23 QString cacheDirectory() const;
24 void setCacheDirectory(const QString &cacheDir);
25
26 qint64 maximumCacheSize() const;
27 void setMaximumCacheSize(qint64 size);
28
29 qint64 cacheSize() const override;
30 QNetworkCacheMetaData metaData(const QUrl &url) override;
31 void updateMetaData(const QNetworkCacheMetaData &metaData) override;
32 QIODevice *data(const QUrl &url) override;
33 bool remove(const QUrl &url) override;
34 QIODevice *prepare(const QNetworkCacheMetaData &metaData) override;
35 void insert(QIODevice *device) override;
36
37 QNetworkCacheMetaData fileMetaData(const QString &fileName) const;
38
39public Q_SLOTS:
40 void clear() override;
41
42protected:
43 virtual qint64 expire();
44
45private:
46 Q_DECLARE_PRIVATE(QNetworkDiskCache)
47 Q_DISABLE_COPY(QNetworkDiskCache)
48};
49
51
52#endif // QNETWORKDISKCACHE_H
IOBluetoothDevice * device
The QAbstractNetworkCache class provides the interface for cache implementations.
\inmodule QtCore \reentrant
Definition qiodevice.h:34
The QNetworkCacheMetaData class provides cache information.
The QNetworkDiskCache class provides a very basic disk cache.
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
b clear()
cache insert(employee->id(), employee)
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static quint64 cacheSize()
#define QT_REQUIRE_CONFIG(feature)
#define Q_OBJECT
#define Q_SLOTS
long long qint64
Definition qtypes.h:60
settings remove("monkey")
QUrl url("example.com")
[constructor-url-reference]
diskCache setCacheDirectory(directory)