OpenShot Library | libopenshot-audio  0.2.0
juce::URL::DownloadTask Class Reference

Represents a download task. More...

#include <juce_URL.h>

+ Inheritance diagram for juce::URL::DownloadTask:

Classes

struct  Listener
 Used to receive callbacks for download progress. More...
 

Public Member Functions

virtual ~DownloadTask ()
 Releases the resources of the download task, unregisters the listener and cancels the download if necessary. More...
 
int64 getTotalLength () const
 Returns the total length of the download task. More...
 
int64 getLengthDownloaded () const
 Returns the number of bytes that have been downloaded so far. 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...
 
bool hadError () const
 Returns true if there was an error. More...
 
File getTargetLocation () const
 Returns the target file location that was provided in URL::downloadToFile. More...
 

Static Public Member Functions

static void juce_iosURLSessionNotify (const String &)
 internal
 

Protected Attributes

int64 contentLength = -1
 
int64 downloaded = 0
 
bool finished = false
 
bool error = false
 
int httpCode = -1
 
File targetLocation
 

Friends

class URL
 

Detailed Description

Represents a download task.

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

Definition at line 356 of file juce_URL.h.

Constructor & Destructor Documentation

◆ ~DownloadTask()

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

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

Definition at line 135 of file juce_URL.cpp.

Member Function Documentation

◆ 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.

Definition at line 380 of file juce_URL.h.

◆ getLengthDownloaded()

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

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

Definition at line 383 of file juce_URL.h.

◆ isFinished()

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

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

Definition at line 386 of file juce_URL.h.

◆ 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

Definition at line 392 of file juce_URL.h.

◆ hadError()

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

Returns true if there was an error.

Definition at line 395 of file juce_URL.h.

◆ getTargetLocation()

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

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

Definition at line 398 of file juce_URL.h.


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