55 URL (
const URL&) =
default;
56 URL& operator= (
const URL&) =
default;
72 bool operator== (
const URL&)
const;
73 bool operator!= (
const URL&)
const;
82 String toString (
bool includeGetParameters)
const;
85 bool isEmpty()
const noexcept;
88 bool isWellFormed()
const;
107 bool isLocalFile()
const;
118 File getLocalFile()
const;
127 String getFileName()
const;
139 URL withNewDomainAndPath (
const String& newFullPath)
const;
146 URL withNewSubPath (
const String& newPath)
const;
158 URL getChildURL (
const String& subPath)
const;
170 URL withParameter (
const String& parameterName,
171 const String& parameterValue)
const;
190 URL withFileToUpload (
const String& parameterName,
191 const File& fileToUpload,
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;
278 static bool isProbablyAWebsiteURL (
const String& possibleURL);
283 static bool isProbablyAnEmailAddress (
const String& possibleEmailAddress);
335 InputStream* createInputStream (
bool doPostLikeRequest,
337 void* progressCallbackContext =
nullptr,
339 int connectionTimeOutMs = 0,
341 int* statusCode =
nullptr,
342 int numRedirectsToFollow = 5,
371 virtual void progress (
URL::DownloadTask* task, int64 bytesDownloaded, int64 totalLength);
401 int64 contentLength = -1, downloaded = 0;
402 bool finished =
false, error =
false;
415 static void juce_iosURLSessionNotify (
const String&);
419 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
DownloadTask)
434 bool usePostCommand =
false);
450 bool readEntireBinaryStream (
MemoryBlock& destData,
451 bool usePostCommand =
false)
const;
467 String readEntireTextStream (
bool usePostCommand =
false)
const;
485 XmlElement* readEntireXmlStream (
bool usePostCommand =
false)
const;
506 static String addEscapeChars (
const String& stringToAddEscapeCharsTo,
508 bool roundBracketsAreLegal =
true);
519 static String removeEscapeChars (
const String& stringToRemoveEscapeCharsFrom);
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)
563 friend void setURLBookmark (
URL&,
void*);
564 friend void* getURLBookmark (
URL&);
571 URL withUpload (Upload*)
const;
573 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.
Used to build a tree of elements representing an XML document.
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.
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.
String getPostData() const noexcept
Returns the data that was set using withPOSTData().
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.