JUCE  v5.1.1-3-g1a0b28c73
JUCE API
URL::DownloadTask Class Reference

Represents a download task. More...

#include <juce_URL.h>

Collaboration diagram for URL::DownloadTask:

Classes

struct  Listener
 

Public Member Functions

virtual ~DownloadTask ()
 Releases the resources of the download task, unregisters the listener and cancels the download if necessary. More...
 
int64 getLengthDownloaded () const
 Returns the number of bytes that have been downloaded so far. More...
 
int64 getTotalLength () const
 Returns the total length of the download task. More...
 
bool hadError () const
 Returns true if there was an error. More...
 
bool isFinished () const
 Returns true if the download finished or there was an error. More...
 
int statusCode () const
 Returns the status code of the server's response. More...
 

Static Public Member Functions

static void juce_iosURLSessionNotify (const String &)
 internal More...
 

Protected Member Functions

 DownloadTask ()
 

Protected Attributes

int64 contentLength
 
int64 downloaded
 
bool error
 
bool finished
 
int httpCode
 

Static Private Member Functions

static DownloadTaskcreateFallbackDownloader (const URL &, const File &, const String &, Listener *)
 

Friends

class URL
 

Detailed Description

Represents a download task.

Returned by downloadToFile to allow querying and controling the download task.

Constructor & Destructor Documentation

◆ ~DownloadTask()

virtual URL::DownloadTask::~DownloadTask ( )
virtual

Releases the resources of the download task, unregisters the listener and cancels the download if necessary.

◆ DownloadTask()

URL::DownloadTask::DownloadTask ( )
protected

Member Function Documentation

◆ createFallbackDownloader()

static DownloadTask* URL::DownloadTask::createFallbackDownloader ( const URL ,
const File ,
const String ,
Listener  
)
staticprivate

◆ getLengthDownloaded()

int64 URL::DownloadTask::getLengthDownloaded ( ) const
inline

Returns the number of bytes that have been downloaded so far.

◆ getTotalLength()

int64 URL::DownloadTask::getTotalLength ( ) const
inline

Returns the total length of the download task.

This may return -1 if the length was not returned by the server.

◆ hadError()

bool URL::DownloadTask::hadError ( ) const
inline

Returns true if there was an error.

◆ isFinished()

bool URL::DownloadTask::isFinished ( ) const
inline

Returns true if the download finished or there was an error.

◆ juce_iosURLSessionNotify()

static void URL::DownloadTask::juce_iosURLSessionNotify ( const String )
static

internal

◆ statusCode()

int URL::DownloadTask::statusCode ( ) const
inline

Returns the status code of the server's response.

This will only be valid after the download has finished.

See also
isFinished

Friends And Related Function Documentation

◆ URL

friend class URL
friend

Member Data Documentation

◆ contentLength

int64 URL::DownloadTask::contentLength
protected

◆ downloaded

int64 URL::DownloadTask::downloaded
protected

◆ error

bool URL::DownloadTask::error
protected

◆ finished

bool URL::DownloadTask::finished
protected

◆ httpCode

int URL::DownloadTask::httpCode
protected

The documentation for this class was generated from the following file: