CopperSpice API
1.9.2
|
The QNetworkCacheMetaData class provides cache information. More...
Public Typedefs | |
typedef QHash< QNetworkRequest::Attribute, QVariant > | AttributesMap |
typedef QPair< QByteArray, QByteArray > | RawHeader |
typedef QList< RawHeader > | RawHeaderList |
Public Methods | |
QNetworkCacheMetaData () | |
QNetworkCacheMetaData (const QNetworkCacheMetaData &other) | |
~QNetworkCacheMetaData () | |
AttributesMap | attributes () const |
QDateTime | expirationDate () const |
bool | isValid () const |
QDateTime | lastModified () const |
bool | operator!= (const QNetworkCacheMetaData &other) const |
QNetworkCacheMetaData & | operator= (const QNetworkCacheMetaData &other) |
QNetworkCacheMetaData & | operator= (QNetworkCacheMetaData &&other) |
bool | operator== (const QNetworkCacheMetaData &other) const |
RawHeaderList | rawHeaders () const |
bool | saveToDisk () const |
void | setAttributes (const AttributesMap &attributes) |
void | setExpirationDate (const QDateTime &dateTime) |
void | setLastModified (const QDateTime &dateTime) |
void | setRawHeaders (const RawHeaderList &list) |
void | setSaveToDisk (bool allow) |
void | setUrl (const QUrl &url) |
void | swap (QNetworkCacheMetaData &other) |
QUrl | url () const |
Related Functions | |
These are not member functions | |
QDataStream & | operator<< (QDataStream &out, const QNetworkCacheMetaData &metaData) |
QDataStream & | operator>> (QDataStream &in, QNetworkCacheMetaData &metaData) |
The QNetworkCacheMetaData class provides cache information. 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.
Equivalent to QPair<QByteArray, QByteArray>.
Equivalent to QList<RawHeader>.
QNetworkCacheMetaData::QNetworkCacheMetaData | ( | ) |
Constructs an invalid network cache meta data.
QNetworkCacheMetaData::QNetworkCacheMetaData | ( | const QNetworkCacheMetaData & | other | ) |
Constructs a copy of the other QNetworkCacheMetaData.
QNetworkCacheMetaData::~QNetworkCacheMetaData | ( | ) |
Destroys the network cache meta data.
AttributesMap QNetworkCacheMetaData::attributes | ( | ) | const |
Returns all the attributes stored with this cache item.
QDateTime QNetworkCacheMetaData::expirationDate | ( | ) | const |
Returns the date and time when the meta data expires.
bool QNetworkCacheMetaData::isValid | ( | ) | const |
Returns true if this network cache meta data has attributes that have been set otherwise false.
QDateTime QNetworkCacheMetaData::lastModified | ( | ) | const |
Returns the date and time when the meta data was last modified.
|
inline |
Returns true if this meta data is not equal to the other meta data, otherwise returns false.
QNetworkCacheMetaData & QNetworkCacheMetaData::operator= | ( | const QNetworkCacheMetaData & | other | ) |
Copy assigns from other and returns a reference to this object.
|
inline |
Move assigns from other and returns a reference to this object.
bool QNetworkCacheMetaData::operator== | ( | const QNetworkCacheMetaData & | other | ) | const |
Returns true if this meta data is equal to the other meta data, otherwise returns false.
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.
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 marked with Pragma: no-cache, or have a Cache-control set to no-store or no-cache or any https document that does not have "Cache-control: public" set will set the saveToDisk to false.
void QNetworkCacheMetaData::setAttributes | ( | const AttributesMap & | attributes | ) |
Sets all attributes of this cache item to be the map attributes.
void QNetworkCacheMetaData::setExpirationDate | ( | const QDateTime & | dateTime | ) |
Sets the date and time when the meta data expires to dateTime.
void QNetworkCacheMetaData::setLastModified | ( | const QDateTime & | dateTime | ) |
Sets the date and time when the meta data was last modified to dateTime.
void QNetworkCacheMetaData::setRawHeaders | ( | const RawHeaderList & | list | ) |
Sets the raw headers to list.
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.
void QNetworkCacheMetaData::setUrl | ( | const QUrl & | url | ) |
Sets the current URL for this metadata to url. The password and fragment are removed from the given url.
|
inline |
Swaps this metadata instance with other. This method is very fast and never fails.
QUrl QNetworkCacheMetaData::url | ( | ) | const |
Returns the URL this network cache meta data is referring to.
|
related |
Writes metaData to the out stream and returns a reference to the stream.
Refer to Serializing Data Types for additional information.
|
related |
Reads a QNetworkCacheMetaData from the stream in into metaData and returns a reference to the stream.
Refer to Serializing Data Types for additional information.