Gin
Loading...
Searching...
No Matches
DownloadManager::DownloadResult Struct Reference

Result of a completed or failed download. More...

#include <gin_downloadmanager.h>

Public Member Functions

bool saveToFile (const juce::File &targetFile, bool overwrite=true)
 Saves downloaded data to a file.

Public Attributes

juce::URL url
 URL that was downloaded.
int downloadId = 0
 Unique download ID.
int attempts = 0
 Number of attempts made.
juce::MemoryBlock data
 Downloaded data; empty for a download to a file.
juce::File file
 Where a download to a file went; deleted unless ok.
bool ok = false
 true if download succeeded
int httpCode = 0
 HTTP response code.
juce::StringPairArray responseHeaders
 HTTP response headers.

Detailed Description

Result of a completed or failed download.

DownloadResult contains all information about a download attempt including the downloaded data, HTTP status, response headers, and success/failure state.

Members:

  • url: The URL that was downloaded
  • downloadId: Unique ID assigned by DownloadManager
  • attempts: Number of attempts made (including retries)
  • data: Downloaded content as MemoryBlock
  • ok: true if download succeeded, false otherwise
  • httpCode: HTTP response code (200 = success, 404 = not found, etc.)
  • responseHeaders: HTTP response headers from server

The result is passed to completion callbacks on the message thread.

See also
DownloadManager

Member Function Documentation

◆ saveToFile()

bool DownloadManager::DownloadResult::saveToFile ( const juce::File & targetFile,
bool overwrite = true )

Saves downloaded data to a file.

Returns true if successful.

Member Data Documentation

◆ url

juce::URL DownloadManager::DownloadResult::url

URL that was downloaded.

◆ downloadId

int DownloadManager::DownloadResult::downloadId = 0

Unique download ID.

◆ attempts

int DownloadManager::DownloadResult::attempts = 0

Number of attempts made.

◆ data

juce::MemoryBlock DownloadManager::DownloadResult::data

Downloaded data; empty for a download to a file.

◆ file

juce::File DownloadManager::DownloadResult::file

Where a download to a file went; deleted unless ok.

◆ ok

bool DownloadManager::DownloadResult::ok = false

true if download succeeded

◆ httpCode

int DownloadManager::DownloadResult::httpCode = 0

HTTP response code.

◆ responseHeaders

juce::StringPairArray DownloadManager::DownloadResult::responseHeaders

HTTP response headers.


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