55 URL (
const URL&) =
default;
85 bool isEmpty()
const noexcept;
88 bool isWellFormed()
const;
170 URL withParameter (
const String& parameterName,
190 URL withFileToUpload (
const String& parameterName,
192 const String& mimeType)
const;
203 URL withDataToUpload (
const String& parameterName,
206 const String& mimeType)
const;
246 URL withPOSTData (
const String& postData)
const;
272 bool launchInDefaultBrowser()
const;
341 int* statusCode =
nullptr,
401 int64 contentLength = -1, downloaded = 0;
402 bool finished =
false, error =
false;
419 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
DownloadTask)
525 static URL createWithoutParsing (
const String& url);
535 static File fileFromFileSchemeURL (
const URL&);
536 String getDomainInternal (
bool)
const;
541 String parameterName, filename, mimeType;
543 std::unique_ptr<MemoryBlock> data;
545 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Upload)
561 Bookmark::Ptr bookmark;
563 friend void setURLBookmark (URL&,
void*);
564 friend void* getURLBookmark (URL&);
567 URL (
const String&,
int);
569 void addParameter (
const String&,
const String&);
570 void createHeadersAndPostData (String&, MemoryBlock&)
const;
571 URL withUpload (Upload*)
const;
573 JUCE_LEAK_DETECTOR (URL)
Holds a resizable array of primitive or copy-by-value objects.
Represents a local file or directory.
A class to hold a resizable block of raw data.
The base class for streams that write data to some kind of destination.
A base class which provides methods for reference-counting.
A special array for holding a list of strings.
A container for holding a set of strings which are keyed by another string.
Represents a download task.
bool hadError() const
Returns true if there was an error.
int64 getLengthDownloaded() const
Returns the number of bytes that have been downloaded so far.
bool isFinished() const
Returns true if the download finished or there was an error.
File getTargetLocation() const
Returns the target file location that was provided in URL::downloadToFile.
int statusCode() const
Returns the status code of the server's response.
static void juce_iosURLSessionNotify(const String &)
internal
int64 getTotalLength() const
Returns the total length of the download task.
Represents a URL and has a bunch of useful functions to manipulate it.
File getLocalFile() const
Returns the file path of the local file to which this URL refers to.
String getFileName() const
Returns the file name.
const MemoryBlock & getPostDataAsMemoryBlock() const noexcept
Returns the data that was set using withPOSTData() as MemoryBlock.
const StringArray & getParameterValues() const noexcept
Returns an array of the values of all the URL's parameters.
bool(void *context, int bytesSent, int totalBytes) OpenStreamProgressCallback
This callback function can be used by the createInputStream() method.
bool isLocalFile() const
Returns true if this URL refers to a local file.
String getPostData() const noexcept
Returns the data that was set using withPOSTData().
const StringArray & getParameterNames() const noexcept
Returns an array of the names of all the URL's parameters.
DownloadTask * downloadToFile(const File &targetLocation, String extraHeaders=String(), DownloadTask::Listener *listener=nullptr, bool usePostCommand=false)
Download the URL to a file.
Used to build a tree of elements representing an XML document.
#define JUCE_API
This macro is added to all JUCE public class declarations.
Used to receive callbacks for download progress.
virtual void finished(URL::DownloadTask *task, bool success)=0
Called when the download has finished.