|
Objectively
Ultra-lightweight object oriented framework for GNU C.
|
#include <URLCache.h>
A cache for HTTP responses.
Definition at line 44 of file URLCache.h.
Properties | |
| size_t | currentSize |
| The current cached body size. | |
| Lock * | lock |
| The lock protecting this cache. | |
| size_t | maxSize |
| The maximum cached body size. | |
| Object | object |
| The superclass. | |
| Dictionary * | responses |
| The cached responses, keyed by URLRequest. | |
Properties inherited from Object | |
| Class * | clazz |
| Every instance of Object begins with a pointer to its Class. | |
| unsigned int | magic |
| A header to allow introspection of Object types. | |
Methods | |
| Class * | _URLCache (void) |
| The URLCache archetype. | |
| URLCachedResponse * | cachedResponseForRequest (URLCache *self, const URLRequest *request) |
| Returns the cached response for the given request. | |
| URLCache * | init (URLCache *self) |
| Initializes this URLCache. | |
| void | removeAllCachedResponses (URLCache *self) |
| Removes all cached responses. | |
| void | removeCachedResponseForRequest (URLCache *self, const URLRequest *request) |
| Removes the cached response for the given request. | |
| void | setMaxSize (URLCache *self, size_t maxSize) |
| Sets the maximum cached body size. | |
| void | storeCachedResponseForRequest (URLCache *self, const URLRequest *request, const URLResponse *response, const Data *data) |
| Stores a cached response for the given request. | |
Methods inherited from Object | |
| Class * | _Object (void) |
| The Object archetype. | |
| Object * | copy (const Object *self) |
| Creates a shallow copy of this Object. | |
| void | dealloc (Object *self) |
| Frees all resources held by this Object. | |
| String * | description (const Object *self) |
| int | hash (const Object *self) |
| Object * | init (Object *self) |
| Initializes this Object. | |
| bool | isEqual (const Object *self, const Object *other) |
| Tests equality of the other Object. | |
| bool | isKindOfClass (const Object *self, const Class *clazz) |
| Tests for Class hierarchy membership. | |
Protected Attributes | |
| URLCacheInterface * | interface |
| The interface. | |
Protected Attributes inherited from Object | |
| ObjectInterface * | interface |
| The interface. | |
| size_t URLCache::currentSize |
The current cached body size.
Definition at line 70 of file URLCache.h.
|
protected |
The interface.
Definition at line 55 of file URLCache.h.
| Lock* URLCache::lock |
The lock protecting this cache.
Definition at line 60 of file URLCache.h.
| size_t URLCache::maxSize |
The maximum cached body size.
Definition at line 75 of file URLCache.h.
| Object URLCache::object |
The superclass.
Definition at line 49 of file URLCache.h.
| Dictionary* URLCache::responses |
The cached responses, keyed by URLRequest.
Definition at line 65 of file URLCache.h.
| Class * _URLCache | ( | void | ) |
The URLCache archetype.
Definition at line 411 of file URLCache.c.
| URLCachedResponse * cachedResponseForRequest | ( | URLCache * | self, |
| const URLRequest * | request | ||
| ) |
Returns the cached response for the given request.
| self | The URLCache. |
| request | The URLRequest. |
NULL if none is cached. Definition at line 268 of file URLCache.c.
Initializes this URLCache.
| self | The URLCache. |
NULL on error. Definition at line 290 of file URLCache.c.
| void removeAllCachedResponses | ( | URLCache * | self | ) |
Removes all cached responses.
| self | The URLCache. |
Definition at line 310 of file URLCache.c.
| void removeCachedResponseForRequest | ( | URLCache * | self, |
| const URLRequest * | request | ||
| ) |
Removes the cached response for the given request.
| self | The URLCache. |
| request | The URLRequest. |
Definition at line 322 of file URLCache.c.
| void setMaxSize | ( | URLCache * | self, |
| size_t | maxSize | ||
| ) |
Sets the maximum cached body size.
| self | The URLCache. |
| maxSize | The maximum cache size. |
Definition at line 338 of file URLCache.c.
| void storeCachedResponseForRequest | ( | URLCache * | self, |
| const URLRequest * | request, | ||
| const URLResponse * | response, | ||
| const Data * | data | ||
| ) |
Stores a cached response for the given request.
| self | The URLCache. |
| request | The URLRequest. |
| response | The HTTP response. |
| data | The response body. |
Definition at line 356 of file URLCache.c.