CopperSpice API  1.7.2
QAbstractNetworkCache Class Referenceabstract

Provides the interface for cache implementations. More...

Inheritance diagram for QAbstractNetworkCache:
QObject QNetworkDiskCache

Public Slots

virtual void clear ()
 
- Public Slots inherited from QObject
void deleteLater ()
 

Public Methods

virtual ~QAbstractNetworkCache ()
 
virtual qint64 cacheSize () const = 0
 
virtual QIODevicedata (const QUrl &url) = 0
 
virtual void insert (QIODevice *device) = 0
 
virtual QNetworkCacheMetaData metaData (const QUrl &url) = 0
 
virtual QIODeviceprepare (const QNetworkCacheMetaData &metaData) = 0
 
virtual bool remove (const QUrl &url) = 0
 
virtual void updateMetaData (const QNetworkCacheMetaData &metaData) = 0
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &objName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 

Protected Methods

 QAbstractNetworkCache (QObject *parent=nullptr)
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 
- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The QAbstractNetworkCache class provides the interface for cache implementations. It is the base class for every standard cache that is used by QNetworkAccessManager. This is an abstract class and can not be instantiated.

See also
QNetworkDiskCache

Constructor & Destructor Documentation

QAbstractNetworkCache::~QAbstractNetworkCache ( )
virtual

Destroys the cache. Any operations that have not been inserted are discarded.

See also
insert()
QAbstractNetworkCache::QAbstractNetworkCache ( QObject parent = nullptr)
explicitprotected

Constructs an abstract network cache with the given parent.

Method Documentation

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.

See also
clear()

Implemented in QNetworkDiskCache.

void QAbstractNetworkCache::clear ( )
slot

Removes all items from the cache. Unless there were failures clearing the cache cacheSize() should return 0 after a call to clear.

See also
cacheSize(), 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.

See also
metaData(), prepare()

Implemented in QNetworkDiskCache.

void QAbstractNetworkCache::insert ( QIODevice device)
pure virtual

Inserts the data in device and the prepared meta data into the cache. After this method 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.

See also
prepare(), remove()

Implemented in QNetworkDiskCache.

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.

See also
updateMetaData(), data()

Implemented in QNetworkDiskCache.

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.

See also
remove(), updateMetaData(), insert()

Implemented in QNetworkDiskCache.

bool QAbstractNetworkCache::remove ( const QUrl url)
pure virtual

Removes the cache entry for url returns true if successful, otherwise returns false.

See also
clear(), prepare()

Implemented in QNetworkDiskCache.

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.

See also
metaData(), prepare()

Implemented in QNetworkDiskCache.