The QNetworkCacheMetaData class provides cache information. 更多...
头: | #include <QNetworkCacheMetaData> |
CMake: |
find_package(Qt6 COMPONENTS Network REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Network) |
qmake: | QT += network |
AttributesMap | |
RawHeader | |
RawHeaderList |
QNetworkCacheMetaData (const QNetworkCacheMetaData & other ) | |
QNetworkCacheMetaData () | |
QNetworkCacheMetaData & | operator= (const QNetworkCacheMetaData & other ) |
~QNetworkCacheMetaData () | |
QNetworkCacheMetaData::AttributesMap | 属性 () const |
QDateTime | expirationDate () const |
bool | isValid () const |
QDateTime | lastModified () const |
QNetworkCacheMetaData::RawHeaderList | rawHeaders () const |
bool | saveToDisk () const |
void | setAttributes (const QNetworkCacheMetaData::AttributesMap & 属性 ) |
void | setExpirationDate (const QDateTime & dateTime ) |
void | setLastModified (const QDateTime & dateTime ) |
void | setRawHeaders (const QNetworkCacheMetaData::RawHeaderList & list ) |
void | setSaveToDisk (bool allow ) |
void | setUrl (const QUrl & url ) |
void | swap (QNetworkCacheMetaData & other ) |
QUrl | url () const |
bool | operator!= (const QNetworkCacheMetaData & other ) const |
bool | operator== (const QNetworkCacheMetaData & other ) const |
QDataStream & | operator<< (QDataStream & out , const QNetworkCacheMetaData & metaData ) |
QDataStream & | operator>> (QDataStream & in , QNetworkCacheMetaData & metaData ) |
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.
另请参阅 QAbstractNetworkCache .
同义词 QHash < QNetworkRequest::Attribute , QVariant >
Synonym for QPair< QByteArray , QByteArray >
构造副本为 other QNetworkCacheMetaData.
Constructs an invalid network cache meta data.
另请参阅 isValid ().
Makes a copy of the other QNetworkCacheMetaData and returns a reference to the copy.
Destroys the network cache meta data.
Returns all the attributes stored with this cache item.
另请参阅 setAttributes () 和 QNetworkRequest::Attribute .
Returns the date and time when the meta data expires.
另请参阅 setExpirationDate ().
返回
true
if this network cache meta data has attributes that have been set otherwise false.
Returns the date and time when the meta data was last modified.
另请参阅 setLastModified ().
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.
另请参阅 setRawHeaders ().
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.
另请参阅 setSaveToDisk ().
Sets all attributes of this cache item to be the map 属性 .
另请参阅 属性 () 和 QNetworkRequest::setAttribute ().
Sets the date and time when the meta data expires to dateTime .
另请参阅 expirationDate ().
Sets the date and time when the meta data was last modified to dateTime .
另请参阅 lastModified ().
Sets the raw headers to list .
另请参阅 rawHeaders ().
Sets whether this network cache meta data and associated content should be allowed to be stored on disk to allow .
另请参阅 saveToDisk ().
Sets the URL this network cache meta data to be url .
The password and fragment are removed from the url.
另请参阅 url ().
[since 5.0]
void
QNetworkCacheMetaData::
swap
(
QNetworkCacheMetaData
&
other
)
Swaps this metadata instance with other 。此函数非常快且从不失败。
该函数在 Qt 5.0 引入。
Returns the URL this network cache meta data is referring to.
另请参阅 setUrl ().
返回
true
if this meta data is not equal to the
other
meta data; otherwise returns
false
.
另请参阅 operator== ().
返回
true
if this meta data is equal to the
other
meta data; otherwise returns
false
.
另请参阅 operator!= ().
写入 metaData 到 out stream.
另请参阅 序列化 Qt 数据类型 .
读取 QNetworkCacheMetaData 从流 in into metaData .
另请参阅 序列化 Qt 数据类型 .