29#define _Class _URLSessionDownloadTask
31#pragma mark - URLSessionTask
33#define CURL_WRITEFUNC_ABORT 0
42 const size_t bytesWritten = fwrite(
data, size, count, this->file);
43 this->urlSessionTask.bytesReceived += bytesWritten;
59 curl_easy_setopt(self->handle, CURLOPT_WRITEFUNCTION,
writeFunction);
60 curl_easy_setopt(self->handle, CURLOPT_WRITEDATA, self);
63#pragma mark - Class lifecycle
83 .name =
"URLSessionDownloadTask",
86 .interfaceSize =
sizeof(URLSessionDownloadTaskInterface),
static void setup(void)
Called when initializing Object to setup Objectively.
Class * _initialize(const ClassDef *def)
Initializes the given Class.
#define super(type, obj, method,...)
void * ident
The identity type, similar to Objective-C id.
Class * _URLSessionDownloadTask(void)
static size_t writeFunction(char *data, size_t size, size_t count, ident self)
The CURLOPT_WRITEFUNCTION callback.
static void initialize(Class *clazz)
Use download tasks to save remote resources to file.
Class * _URLSessionTask(void)
#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.
ident interface
The interface of the Class.
Use download tasks to save remote resources to file.
URL session tasks are handles to pending URL operations.