#include <assert.h>
#include "URLCachedResponse.h"
#include "Hash.h"
Go to the source code of this file.
◆ _Class
◆ _URLCachedResponse()
| Class * _URLCachedResponse |
( |
void |
| ) |
|
Definition at line 164 of file URLCachedResponse.c.
164 {
167
170 .name = "URLCachedResponse",
174 .interfaceSize = sizeof(URLCachedResponseInterface),
176 });
177 });
178
179 return clazz;
180}
Class * _initialize(const ClassDef *def)
Initializes the given Class.
static void initialize(Class *clazz)
#define do_once(once, block)
Executes the given block at most one time.
ClassDefs are passed to _initialize via an archetype to initialize a Class.
The runtime representation of a Class.
◆ copy()
- See also
- Object::copy(const Object *)
Definition at line 48 of file URLCachedResponse.c.
48 {
49
51
53 if (that) {
56 that->
size = this->size;
57 }
58
60}
ident release(ident obj)
Atomically decrement the given Object's reference count. If the resulting reference count is 0,...
#define alloc(type)
Allocate and initialize and instance of type.
static Object * copy(const Object *self)
static URLCachedResponse * initWithResponseData(URLCachedResponse *self, const URLResponse *response, const Data *data)
Microsecond-precision immutable dates.
Object is the root Class of The Objectively Class hierarchy.
Date * timestamp
The time this response was cached.
size_t size
The cached body size.
◆ dealloc()
| static void dealloc |
( |
Object * |
self | ) |
|
|
static |
◆ hash()
| static int hash |
( |
const Object * |
self | ) |
|
|
static |
- See also
- Object::hash(const Object *)
Definition at line 79 of file URLCachedResponse.c.
79 {
80
82
89
91}
int HashForInteger(int hash, const long integer)
Accumulates the hash value of integer into hash.
int HashForObject(int hash, const ident obj)
Accumulates the hash value of object into hash.
#define HASH_SEED
The hash seed value.
static int hash(const Object *self)
◆ initialize()
| static void initialize |
( |
Class * |
clazz | ) |
|
|
static |
- See also
- Class::initialize(Class *)
Definition at line 150 of file URLCachedResponse.c.
150 {
151
156
158}
static bool isEqual(const Object *self, const Object *other)
ident interface
The interface of the Class.
void dealloc(Object *self)
Frees all resources held by this Object.
◆ initWithResponseData()
Definition at line 123 of file URLCachedResponse.c.
124 {
125
126 assert(response);
127
129 if (self) {
131
134 } else {
136 }
137
140 }
141
142 return self;
143}
static Array * init(Array *self)
static Data * initWithBytes(Data *self, const uint8_t *bytes, size_t length)
size_t length
The length of bytes.
uint8_t * bytes
The bytes.
URLResponse * response
The HTTP response.
Data * data
The response body.
A protocol-agnostic abstraction for URLSessionTask responses.
◆ isEqual()
| static bool isEqual |
( |
const Object * |
self, |
|
|
const Object * |
other |
|
) |
| |
|
static |
- See also
- Object::isEqual(const Object *, const Object *)
Definition at line 96 of file URLCachedResponse.c.
96 {
97
99 return true;
100 }
101
103
106
107 return this->size == that->
size
112 }
113
114 return false;
115}
static bool isKindOfClass(const Object *self, const Class *clazz)
Class * _URLCachedResponse(void)
static bool objectEquals(const Object *self, const Object *other)
Tests equality of two Objects, accounting for NULL.
Dictionary * httpHeaders
The HTTP response headers.
int httpStatusCode
The HTTP response status code.
◆ objectEquals()
| static bool objectEquals |
( |
const Object * |
self, |
|
|
const Object * |
other |
|
) |
| |
|
static |
Tests equality of two Objects, accounting for NULL.
Definition at line 36 of file URLCachedResponse.c.
36 {
37
38 if (self) {
39 return other && $(self,
isEqual, other);
40 }
41
42 return other == NULL;
43}