Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QAbstractNetworkCache Class

The QAbstractNetworkCache class provides the interface for cache implementations. More...

 #include <QAbstractNetworkCache>

Inherits: QObject.

Inherited by: QNetworkDiskCache.

This class was introduced in Qt 4.5.

Public Functions

virtual ~QAbstractNetworkCache()
virtual qint64 cacheSize() const = 0
virtual QIODevice * data(const QUrl & url) = 0
virtual void insert(QIODevice * device) = 0
virtual QNetworkCacheMetaData metaData(const QUrl & url) = 0
virtual QIODevice * prepare(const QNetworkCacheMetaData & metaData) = 0
virtual bool remove(const QUrl & url) = 0
virtual void updateMetaData(const QNetworkCacheMetaData & metaData) = 0
  • 31 public functions inherited from QObject

Public Slots

virtual void clear() = 0
  • 1 public slot inherited from QObject

Protected Functions

QAbstractNetworkCache(QObject * parent = 0)
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 2 signal inherited from QObject
  • 11 static public members inherited from QObject

Detailed Description

The QAbstractNetworkCache class provides the interface for cache implementations.

QAbstractNetworkCache is the base class for every standard cache that is used be QNetworkAccessManager. QAbstractNetworkCache is an abstract class and cannot be instantiated.

See also QNetworkDiskCache.

Member Function Documentation

QAbstractNetworkCache::QAbstractNetworkCache(QObject * parent = 0) [protected]

Constructs an abstract network cache with the given parent.

QAbstractNetworkCache::~QAbstractNetworkCache() [virtual]

Destroys the cache.

Any operations that have not been inserted are discarded.

See also insert().

qint64 QAbstractNetworkCache::cacheSize() const [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.

See also clear().

void QAbstractNetworkCache::clear() [pure virtual slot]

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 cacheSize() and remove().

QIODevice * QAbstractNetworkCache::data(const QUrl & url) [pure virtual]

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 metaData() and prepare().

void QAbstractNetworkCache::insert(QIODevice * device) [pure virtual]

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.

See also prepare() and remove().

QNetworkCacheMetaData QAbstractNetworkCache::metaData(const QUrl & url) [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.

See also updateMetaData() and data().

QIODevice * QAbstractNetworkCache::prepare(const QNetworkCacheMetaData & metaData) [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 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 remove(), updateMetaData(), and insert().

bool QAbstractNetworkCache::remove(const QUrl & url) [pure virtual]

Removes the cache entry for url, returning true if success otherwise false.

In the base class this is a pure virtual function.

See also clear() and prepare().

void QAbstractNetworkCache::updateMetaData(const QNetworkCacheMetaData & metaData) [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.

See also metaData() and prepare().

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web