QAbstractNetworkCache¶
The
QAbstractNetworkCache
class provides the interface for cache implementations. More…
Inherited by: QNetworkDiskCache
Detailed Description¶
QAbstractNetworkCache
is the base class for every standard cache that is used byQNetworkAccessManager
.QAbstractNetworkCache
is an abstract class and cannot be instantiated.See also
-
class
QAbstractNetworkCache
([parent=None])¶ - param parent
QObject
Constructs an abstract network cache with the given
parent
.
-
PySide2.QtNetwork.QAbstractNetworkCache.
cacheSize
()¶ - Return type
qint64
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.
See also
-
PySide2.QtNetwork.QAbstractNetworkCache.
clear
()¶ 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.
See also
-
PySide2.QtNetwork.QAbstractNetworkCache.
data
(url)¶ - Parameters
url –
QUrl
- Return type
QIODevice
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 0 is returned.In the base class this is a pure virtual function.
See also
-
PySide2.QtNetwork.QAbstractNetworkCache.
insert
(device)¶ - Parameters
device –
QIODevice
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 usingdata()
andmetaData()
.To cancel a prepared inserted call
remove()
on the metadata’s url.In the base class this is a pure virtual function.
-
PySide2.QtNetwork.QAbstractNetworkCache.
metaData
(url)¶ - Parameters
url –
QUrl
- Return type
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.
See also
-
PySide2.QtNetwork.QAbstractNetworkCache.
prepare
(metaData)¶ - Parameters
metaData –
QNetworkCacheMetaData
- Return type
QIODevice
Returns the device that should be populated with the data for the cache item
metaData
. When all of the data has been writteninsert()
should be called. IfmetaData
is invalid or the url in the metadata is invalid 0 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.
See also
-
PySide2.QtNetwork.QAbstractNetworkCache.
remove
(url)¶ - Parameters
url –
QUrl
- Return type
bool
Removes the cache entry for
url
, returning true if success otherwise false.In the base class this is a pure virtual function.
-
PySide2.QtNetwork.QAbstractNetworkCache.
updateMetaData
(metaData)¶ - Parameters
metaData –
QNetworkCacheMetaData
Updates the cache meta date for the
metaData
‘s url tometaData
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.
See also
© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.