JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::URL::DownloadTask Class Reference

Represents a download task. More...

#include <juce_URL.h>

Collaboration diagram for juce::URL::DownloadTask:

Public Types

using Listener = DownloadTaskListener
 

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...
 
File getTargetLocation () const
 Returns the target file location that was provided in URL::downloadToFile. 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 = -1
 
int64 downloaded = 0
 
bool error = false
 
bool finished = false
 
int httpCode = -1
 
File targetLocation
 

Static Private Member Functions

static std::unique_ptr< DownloadTaskcreateFallbackDownloader (const URL &, const File &, const DownloadTaskOptions &)
 

Friends

class URL
 

Detailed Description

Represents a download task.

Returned by downloadToFile() to allow querying and controlling the download task.

Member Typedef Documentation

◆ Listener

Constructor & Destructor Documentation

◆ ~DownloadTask()

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

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

◆ DownloadTask()

juce::URL::DownloadTask::DownloadTask ( )
protected

Member Function Documentation

◆ createFallbackDownloader()

static std::unique_ptr<DownloadTask> juce::URL::DownloadTask::createFallbackDownloader ( const URL ,
const File ,
const DownloadTaskOptions  
)
staticprivate

◆ getLengthDownloaded()

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

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

◆ getTargetLocation()

File juce::URL::DownloadTask::getTargetLocation ( ) const
inline

Returns the target file location that was provided in URL::downloadToFile.

◆ getTotalLength()

int64 juce::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 juce::URL::DownloadTask::hadError ( ) const
inline

Returns true if there was an error.

◆ isFinished()

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

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

◆ juce_iosURLSessionNotify()

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

internal

◆ statusCode()

int juce::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 juce::URL::DownloadTask::contentLength = -1
protected

◆ downloaded

int64 juce::URL::DownloadTask::downloaded = 0
protected

◆ error

bool juce::URL::DownloadTask::error = false
protected

◆ finished

bool juce::URL::DownloadTask::finished = false
protected

◆ httpCode

int juce::URL::DownloadTask::httpCode = -1
protected

◆ targetLocation

File juce::URL::DownloadTask::targetLocation
protected

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