class KIOCachedJob
|
Transparent access to cached data.
More... |
|
|
Public Types
- enum Step {STEP_NONE, STEP_REDIRECTION, STEP_DATE, STEP_MIME, STEP_DATA, STEP_FINISHED }
Public Methods
Protected Slots
- virtual void slotFinished ()
- virtual void slotData ( void *_data, int _len)
- virtual void slotRedirection ( const char *_url )
- virtual void slotMimeType ( const char *_mime )
- virtual void slotError ( int, const char* )
- void slotTimeout ()
Protected Members
Detailed Description
KIOCachedJob provides a means to transparently access data that may
reside in a local on-disk cache. Transparent means you don't need
to worry about the details, just use KIOCachedJob like you would
use KIOJob. KIOCachedJob will fetch the requested documents from the
cache if appropriate and get them from their original source if not
(see KIOCache for details like caching strategy and the
like).
KIOCachedJob provides the same interface as KIOJob with one
addition: forceReload can be used to force reloading of a
document even if it is in cache and valid.
Right now, data is only cached (and searched in cache) when it is
requested by calling get(), all other request methods ignore the cache.
Do not depend on this however, this can and most probably will
change in future.
Constructs a new job. Overloaded from KIOJob
void forceReload (bool _force_reload = TRUE)
|
Calling forceReload(TRUE) (or forceReload() for convenience)
forces KIOCachedJob to retrieve all documents requested before a
subsequent call to forceReload(FALSE) directly from the original
source, even if they are in cache and valid. It doesn't turn off
caching of these documents however, use KIOCache::enable(FALSE)
to turn off caching altogether or use KIOJob instead of
CachedIOJob to bypass the cache for certain documents.
void get ( const char *_url, bool _reload = false )
|
Retrieve _url, get it from cache if possible and if _reload is
FALSE. Data is delivered by sending appropriate signals (see
KIOJob for details).
[protected virtual slot]
This slot is connected to the see #finished signal of the same
KIOCachedJob when a document is retrieved and should be stored
in cache. The document is written to the cache in this function.
void slotData ( void *_data, int _len)
|
[protected virtual slot]
This slot is connected to the @see #data signal of this object
while a document is retrieved that should be stored in cache.
It simply adds all data received to @see dataBuffer which is
used later to store all of the data in cache (and maybe to pass
the data already available to KIOCachedJobs in repeater mode).
[protected slot]
This slot is connected to the @see #date signal of this object
while a document is retrieved that should be stored in
cache. It stores the appropriate dates (most notably EXPIRES)
in order to commit them to cache later when @see #commitToCache
is called.
[protected]
If TRUE, get documents from cache if possible. If false,
always retrieve documents from the original source. See also
forceReload. By default, look_in_cache is TRUE.
[protected]
A pointer to the new cache entry for the current document.
Generated by: root@tantive.terraplex.com on Sun Feb 27 17:39:31 2000, using kdoc 2.0a33. |