55 URL (
const URL&) =
default;
56 URL& operator= (
const URL&) =
default;
58 URL& operator= (
URL&&) =
default;
70 bool operator== (
const URL&)
const;
71 bool operator!= (
const URL&)
const;
80 String toString (
bool includeGetParameters)
const;
83 bool isEmpty()
const noexcept;
86 bool isWellFormed()
const;
100 String getSubPath (
bool includeGetParameters =
false)
const;
105 String getQueryString()
const;
114 bool isLocalFile()
const;
125 File getLocalFile()
const;
134 String getFileName()
const;
146 URL withNewDomainAndPath (
const String& newFullPath)
const;
153 URL withNewSubPath (
const String& newPath)
const;
158 URL getParentURL()
const;
170 URL getChildURL (
const String& subPath)
const;
182 URL withParameter (
const String& parameterName,
183 const String& parameterValue)
const;
202 URL withFileToUpload (
const String& parameterName,
203 const File& fileToUpload,
204 const String& mimeType)
const;
215 URL withDataToUpload (
const String& parameterName,
218 const String& mimeType)
const;
258 URL withPOSTData (
const String& postData)
const;
284 bool launchInDefaultBrowser()
const;
290 static bool isProbablyAWebsiteURL (
const String& possibleURL);
295 static bool isProbablyAnEmailAddress (
const String& possibleEmailAddress);
347 InputStream* createInputStream (
bool doPostLikeRequest,
349 void* progressCallbackContext =
nullptr,
351 int connectionTimeOutMs = 0,
353 int* statusCode =
nullptr,
354 int numRedirectsToFollow = 5,
355 String httpRequestCmd = {})
const;
383 virtual void progress (
URL::DownloadTask* task, int64 bytesDownloaded, int64 totalLength);
413 int64 contentLength = -1, downloaded = 0;
414 bool finished =
false, error =
false;
427 static void juce_iosURLSessionNotify (
const String&);
431 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
DownloadTask)
446 bool usePostCommand =
false);
462 bool readEntireBinaryStream (
MemoryBlock& destData,
463 bool usePostCommand =
false)
const;
479 String readEntireTextStream (
bool usePostCommand =
false)
const;
497 std::unique_ptr<XmlElement> readEntireXmlStream (
bool usePostCommand =
false)
const;
518 static String addEscapeChars (
const String& stringToAddEscapeCharsTo,
520 bool roundBracketsAreLegal =
true);
531 static String removeEscapeChars (
const String& stringToRemoveEscapeCharsFrom);
537 static URL createWithoutParsing (
const String& url);
547 static File fileFromFileSchemeURL (
const URL&);
548 String getDomainInternal (
bool)
const;
553 String parameterName, filename, mimeType;
555 std::unique_ptr<MemoryBlock> data;
557 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Upload)
575 friend void setURLBookmark (
URL&,
void*);
576 friend void* getURLBookmark (
URL&);
583 URL withUpload (Upload*)
const;
585 JUCE_LEAK_DETECTOR (
URL)
int statusCode() const
Returns the status code of the server's response.
#define JUCE_API
This macro is added to all JUCE public class declarations.
Represents a download task.
const StringArray & getParameterValues() const noexcept
Returns an array of the values of all the URL's parameters.
A special array for holding a list of strings.
bool hadError() const
Returns true if there was an error.
String toString() const
Attempts to parse the contents of the block as a zero-terminated UTF8 string.
const StringArray & getParameterNames() const noexcept
Returns an array of the names of all the URL's parameters.
Represents a local file or directory.
The base class for streams that write data to some kind of destination.
bool isFinished() const
Returns true if the download finished or there was an error.
String getPostData() const
Returns the data that was set using withPOSTData().
int64 getTotalLength() const
Returns the total length of the download task.
int64 getLengthDownloaded() const
Returns the number of bytes that have been downloaded so far.
File getTargetLocation() const
Returns the target file location that was provided in URL::downloadToFile.
const MemoryBlock & getPostDataAsMemoryBlock() const noexcept
Returns the data that was set using withPOSTData() as MemoryBlock.
A container for holding a set of strings which are keyed by another string.
Used to receive callbacks for download progress.
A base class which provides methods for reference-counting.
A class to hold a resizable block of raw data.
bool(void *context, int bytesSent, int totalBytes) OpenStreamProgressCallback
This callback function can be used by the createInputStream() method.
Represents a URL and has a bunch of useful functions to manipulate it.