QtBase
v6.3.1
|
The QAbstractNetworkCache class provides the interface for cache implementations. More...
#include <qabstractnetworkcache.h>
Public Slots | |
virtual void | clear ()=0 |
Public Slots inherited from QObject | |
void | deleteLater () |
Protected Member Functions | |
QAbstractNetworkCache (QObject *parent=nullptr) | |
QAbstractNetworkCache (QAbstractNetworkCachePrivate &dd, QObject *parent) | |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
The QAbstractNetworkCache class provides the interface for cache implementations.
QAbstractNetworkCache is the base class for every standard cache that is used by QNetworkAccessManager. QAbstractNetworkCache is an abstract class and cannot be instantiated.
Definition at line 111 of file qabstractnetworkcache.h.
|
virtual |
Destroys the cache.
Any operations that have not been inserted are discarded.
Definition at line 445 of file qabstractnetworkcache.cpp.
Constructs an abstract network cache with the given parent.
Definition at line 425 of file qabstractnetworkcache.cpp.
|
protected |
Definition at line 433 of file qabstractnetworkcache.cpp.
|
pure virtual |
Returns the current size taken up by the cache. Depending upon the cache implementation this might be disk or memory size.
In the base class this is a pure virtual function.
Implemented in MySpyMemoryCache, MyMemoryCache, and QNetworkDiskCache.
|
pure virtualslot |
Removes all items from the cache. Unless there was failures clearing the cache cacheSize() should return 0 after a call to clear.
In the base class this is a pure virtual function.
Implemented in MySpyMemoryCache, and MyMemoryCache.
Returns the data associated with url.
It is up to the application that requests the data to delete the QIODevice when done with it.
If there is no cache for url, the url is invalid, or if there is an internal cache error \nullptr is returned.
In the base class this is a pure virtual function.
Implemented in MySpyMemoryCache, MyMemoryCache, NetworkDiskCache, QNetworkDiskCache, and NetworkDiskCache.
Inserts the data in device and the prepared meta data into the cache. After this function is called the data and meta data should be retrievable using data() and metaData().
To cancel a prepared inserted call remove() on the metadata's url.
In the base class this is a pure virtual function.
Implemented in QNetworkDiskCache, MySpyMemoryCache, and MyMemoryCache.
|
pure virtual |
Returns the meta data for the url url.
If the url is valid and the cache contains the data for url, a valid QNetworkCacheMetaData is returned.
In the base class this is a pure virtual function.
Implemented in NetworkDiskCache, MyMemoryCache, QNetworkDiskCache, and MySpyMemoryCache.
|
pure virtual |
Returns the device that should be populated with the data for the cache item metaData. When all of the data has been written insert() should be called. If metaData is invalid or the url in the metadata is invalid \nullptr is returned.
The cache owns the device and will take care of deleting it when it is inserted or removed.
To cancel a prepared inserted call remove() on the metadata's url.
In the base class this is a pure virtual function.
Implemented in MySpyMemoryCache, QNetworkDiskCache, and MyMemoryCache.
Removes the cache entry for url, returning true if success otherwise false.
In the base class this is a pure virtual function.
Implemented in MySpyMemoryCache, MyMemoryCache, and QNetworkDiskCache.
|
pure virtual |
Updates the cache meta date for the metaData's url to metaData
If the cache does not contains a cache item for the url then no action is taken.
In the base class this is a pure virtual function.
Implemented in MyMemoryCache, QNetworkDiskCache, and MySpyMemoryCache.