Gin
Loading...
Searching...
No Matches
AsyncDownload Class Reference

Async Download. More...

#include <gin_util.h>

Inherits juce::Thread, and juce::AsyncUpdater.

Public Member Functions

 AsyncDownload (juce::String url_, std::function< void(AsyncDownload *, const juce::MemoryBlock &, bool)> cb_, int timeoutMS_=0)
 AsyncDownload (juce::URL url_, std::function< void(AsyncDownload *, const juce::MemoryBlock &, bool)> cb_, int timeoutMS_=0)
 ~AsyncDownload () override
void run () override
bool readEntireBinaryStream (juce::MemoryBlock &destData, bool usePostCommand=false)
void handleAsyncUpdate () override

Public Attributes

juce::URL url
std::function< void(AsyncDownload *, juce::MemoryBlock, bool)> cb
int timeoutMS = 0
bool ok = false
juce::MemoryBlock data

Detailed Description

Async Download.

Doesn't have the main thread pause the URL::downloadToFile has

Constructor & Destructor Documentation

◆ AsyncDownload() [1/2]

AsyncDownload::AsyncDownload ( juce::String url_,
std::function< void(AsyncDownload *, const juce::MemoryBlock &, bool)> cb_,
int timeoutMS_ = 0 )

References AsyncDownload(), cb, timeoutMS, and url.

Referenced by AsyncDownload(), and AsyncDownload().

◆ AsyncDownload() [2/2]

AsyncDownload::AsyncDownload ( juce::URL url_,
std::function< void(AsyncDownload *, const juce::MemoryBlock &, bool)> cb_,
int timeoutMS_ = 0 )

References AsyncDownload(), cb, timeoutMS, and url.

◆ ~AsyncDownload()

AsyncDownload::~AsyncDownload ( )
override

Member Function Documentation

◆ run()

void AsyncDownload::run ( )
override

References data, ok, and readEntireBinaryStream().

◆ readEntireBinaryStream()

bool AsyncDownload::readEntireBinaryStream ( juce::MemoryBlock & destData,
bool usePostCommand = false )

References timeoutMS, and url.

Referenced by run().

◆ handleAsyncUpdate()

void AsyncDownload::handleAsyncUpdate ( )
override

References cb, data, and ok.

Member Data Documentation

◆ url

juce::URL AsyncDownload::url

◆ cb

std::function<void (AsyncDownload*, juce::MemoryBlock, bool)> AsyncDownload::cb

◆ timeoutMS

int AsyncDownload::timeoutMS = 0

◆ ok

bool AsyncDownload::ok = false

Referenced by handleAsyncUpdate(), and run().

◆ data

juce::MemoryBlock AsyncDownload::data

Referenced by handleAsyncUpdate(), and run().


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