![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QNetworkCacheMetaData class provides cache information. More...
#include <qabstractnetworkcache.h>
Public Types | |
typedef std::pair< QByteArray, QByteArray > | RawHeader |
Synonym for std::pair<QByteArray, QByteArray> | |
typedef QList< RawHeader > | RawHeaderList |
Synonym for QList<RawHeader> | |
typedef QHash< QNetworkRequest::Attribute, QVariant > | AttributesMap |
Synonym for QHash<QNetworkRequest::Attribute, QVariant> |
Public Member Functions | |
QNetworkCacheMetaData () | |
Constructs an invalid network cache meta data. | |
QNetworkCacheMetaData (const QNetworkCacheMetaData &other) | |
Constructs a copy of the other QNetworkCacheMetaData. | |
~QNetworkCacheMetaData () | |
Destroys the network cache meta data. | |
QNetworkCacheMetaData & | operator= (QNetworkCacheMetaData &&other) noexcept |
QNetworkCacheMetaData & | operator= (const QNetworkCacheMetaData &other) |
Makes a copy of the other QNetworkCacheMetaData and returns a reference to the copy. | |
void | swap (QNetworkCacheMetaData &other) noexcept |
bool | operator== (const QNetworkCacheMetaData &other) const |
Returns true if this meta data is equal to the other meta data; otherwise returns false . | |
bool | operator!= (const QNetworkCacheMetaData &other) const |
Returns true if this meta data is not equal to the other meta data; otherwise returns false . | |
bool | isValid () const |
Returns true if this network cache meta data has attributes that have been set otherwise false. | |
QUrl | url () const |
Returns the URL this network cache meta data is referring to. | |
void | setUrl (const QUrl &url) |
Sets the URL this network cache meta data to be url. | |
RawHeaderList | rawHeaders () const |
Returns a list of all raw headers that are set in this meta data. | |
void | setRawHeaders (const RawHeaderList &headers) |
Sets the raw headers to list. | |
QHttpHeaders | headers () const |
void | setHeaders (const QHttpHeaders &headers) |
QDateTime | lastModified () const |
Returns the date and time when the meta data was last modified. | |
void | setLastModified (const QDateTime &dateTime) |
Sets the date and time when the meta data was last modified to dateTime. | |
QDateTime | expirationDate () const |
Returns the date and time when the meta data expires. | |
void | setExpirationDate (const QDateTime &dateTime) |
Sets the date and time when the meta data expires to dateTime. | |
bool | saveToDisk () const |
Returns is this cache should be allowed to be stored on disk. | |
void | setSaveToDisk (bool allow) |
Sets whether this network cache meta data and associated content should be allowed to be stored on disk to allow. | |
AttributesMap | attributes () const |
void | setAttributes (const AttributesMap &attributes) |
Friends | |
class | QNetworkCacheMetaDataPrivate |
Related Symbols | |
(Note that these are not member symbols.) | |
QDataStream & | operator<< (QDataStream &out, const QNetworkCacheMetaData &metaData) |
QDataStream & | operator>> (QDataStream &in, QNetworkCacheMetaData &metaData) |
The QNetworkCacheMetaData class provides cache information.
\inmodule QtNetwork
QNetworkCacheMetaData provides information about a cache file including the url, when it was last modified, when the cache file was created, headers for file and if the file should be saved onto a disk.
Definition at line 23 of file qabstractnetworkcache.h.
Synonym for QHash<QNetworkRequest::Attribute, QVariant>
Definition at line 29 of file qabstractnetworkcache.h.
typedef std::pair<QByteArray, QByteArray> QNetworkCacheMetaData::RawHeader |
Synonym for std::pair<QByteArray, QByteArray>
Definition at line 27 of file qabstractnetworkcache.h.
Synonym for QList<RawHeader>
Definition at line 28 of file qabstractnetworkcache.h.
QNetworkCacheMetaData::QNetworkCacheMetaData | ( | ) |
Constructs an invalid network cache meta data.
Definition at line 88 of file qabstractnetworkcache.cpp.
QNetworkCacheMetaData::QNetworkCacheMetaData | ( | const QNetworkCacheMetaData & | other | ) |
Constructs a copy of the other QNetworkCacheMetaData.
Definition at line 104 of file qabstractnetworkcache.cpp.
QNetworkCacheMetaData::~QNetworkCacheMetaData | ( | ) |
Destroys the network cache meta data.
Definition at line 96 of file qabstractnetworkcache.cpp.
QNetworkCacheMetaData::AttributesMap QNetworkCacheMetaData::attributes | ( | ) | const |
Returns all the attributes stored with this cache item.
Definition at line 291 of file qabstractnetworkcache.cpp.
QDateTime QNetworkCacheMetaData::expirationDate | ( | ) | const |
Returns the date and time when the meta data expires.
Definition at line 271 of file qabstractnetworkcache.cpp.
QHttpHeaders QNetworkCacheMetaData::headers | ( | ) | const |
Returns headers in form of QHttpHeaders that are set in this meta data.
Definition at line 235 of file qabstractnetworkcache.cpp.
bool QNetworkCacheMetaData::isValid | ( | ) | const |
Returns true
if this network cache meta data has attributes that have been set otherwise false.
Definition at line 149 of file qabstractnetworkcache.cpp.
QDateTime QNetworkCacheMetaData::lastModified | ( | ) | const |
Returns the date and time when the meta data was last modified.
Definition at line 255 of file qabstractnetworkcache.cpp.
|
inline |
Returns true
if this meta data is not equal to the other meta data; otherwise returns false
.
Definition at line 42 of file qabstractnetworkcache.h.
QNetworkCacheMetaData & QNetworkCacheMetaData::operator= | ( | const QNetworkCacheMetaData & | other | ) |
Makes a copy of the other QNetworkCacheMetaData and returns a reference to the copy.
Definition at line 112 of file qabstractnetworkcache.cpp.
|
inlinenoexcept |
Definition at line 35 of file qabstractnetworkcache.h.
bool QNetworkCacheMetaData::operator== | ( | const QNetworkCacheMetaData & | other | ) | const |
Returns true
if this meta data is equal to the other meta data; otherwise returns false
.
Definition at line 129 of file qabstractnetworkcache.cpp.
QNetworkCacheMetaData::RawHeaderList QNetworkCacheMetaData::rawHeaders | ( | ) | const |
Returns a list of all raw headers that are set in this meta data.
The list is in the same order that the headers were set.
Definition at line 213 of file qabstractnetworkcache.cpp.
bool QNetworkCacheMetaData::saveToDisk | ( | ) | const |
Returns is this cache should be allowed to be stored on disk.
Some cache implementations can keep these cache items in memory for performance reasons, but for security reasons they should not be written to disk.
Specifically with http, documents with Cache-control set to no-store or any https document that doesn't have "Cache-control: public" set will set the saveToDisk to false.
Definition at line 166 of file qabstractnetworkcache.cpp.
void QNetworkCacheMetaData::setAttributes | ( | const AttributesMap & | attributes | ) |
Sets all attributes of this cache item to be the map attributes.
Definition at line 303 of file qabstractnetworkcache.cpp.
Sets the date and time when the meta data expires to dateTime.
Definition at line 279 of file qabstractnetworkcache.cpp.
void QNetworkCacheMetaData::setHeaders | ( | const QHttpHeaders & | headers | ) |
Sets the headers of this network cache meta data to headers.
Definition at line 247 of file qabstractnetworkcache.cpp.
Sets the date and time when the meta data was last modified to dateTime.
Definition at line 263 of file qabstractnetworkcache.cpp.
void QNetworkCacheMetaData::setRawHeaders | ( | const RawHeaderList & | list | ) |
Sets the raw headers to list.
Definition at line 223 of file qabstractnetworkcache.cpp.
void QNetworkCacheMetaData::setSaveToDisk | ( | bool | allow | ) |
Sets whether this network cache meta data and associated content should be allowed to be stored on disk to allow.
Definition at line 177 of file qabstractnetworkcache.cpp.
Sets the URL this network cache meta data to be url.
The password and fragment are removed from the url.
Definition at line 199 of file qabstractnetworkcache.cpp.
|
inlinenoexcept |
Definition at line 38 of file qabstractnetworkcache.h.
QUrl QNetworkCacheMetaData::url | ( | ) | const |
Returns the URL this network cache meta data is referring to.
Definition at line 187 of file qabstractnetworkcache.cpp.
|
Writes metaData to the out stream.
Definition at line 316 of file qabstractnetworkcache.cpp.
|
Reads a QNetworkCacheMetaData from the stream in into metaData.
Definition at line 354 of file qabstractnetworkcache.cpp.
|
friend |
Definition at line 69 of file qabstractnetworkcache.h.