A class representing a URL (Uniform Resource Locator). More...
#include <URL.h++>
Public Member Functions | |
| URL () | |
| Construct a new, empty URL. | |
| URL (const String &url) | |
| Construct a new URL for the given URL string. | |
| URL (const URL &other) | |
| Copy constructor. | |
| ~URL () throw () | |
| Destructor. | |
| void | setScheme (const String &scheme) |
| Set the scheme component of the URL. | |
| String | getScheme () const |
| Get the scheme component of the URL. | |
| void | setHost (const String &host) |
| Set the hostname component of the URL. | |
| String | getHost () const |
| Get the hostname component of the URL. | |
| void | setPort (uint16_t port) throw () |
| Set the port number for the URL. | |
| uint16_t | getPort () const throw () |
| Get the port number for the URL. | |
| void | setPath (const String &path) |
| Set the path component of the URL. | |
| String | getPath () const |
| Get the path component of the URL. | |
| String | getCanonicalPath () const |
| Get the path component of the URL, in canonicalized form. | |
| void | setQuery (const String &query) |
| Set the query component of the URL. | |
| String | getQuery () const |
| Get the query component of the URL. | |
| bool | isValid () const throw () |
| Test if the URL is valid. | |
| String | toString () const |
| Get a String representation of the URL. | |
| bool | operator== (const URL &other) const throw () |
| Equality operator. | |
| bool | operator!= (const URL &other) const throw () |
| Inequality operator. | |
| URL & | operator= (const String &other) |
| Assignment operator. | |
| URL & | operator= (const URL &other) |
| Assignment operator. | |
Static Public Member Functions | |
| static String | encode (const String &str) |
| URL-encode a String. | |
| static String | decode (const String &str) |
| Decode a URL-encoded String. | |
A class representing a URL (Uniform Resource Locator).
This class will parse simple, common URLs, but is not a fully-conformant URL parser.
| ~URL | ( | ) | throw () |
Destructor.
Decode a URL-encoded String.
| str | The string to decode. |
URL-encode a String.
| str | The string to encode. |
| String getCanonicalPath | ( | ) | const [inline] |
Get the path component of the URL, in canonicalized form.
| uint16_t getPort | ( | ) | const throw () [inline] |
Get the port number for the URL.
Returns 0 if no port number was specified.
| String getQuery | ( | ) | const [inline] |
Get the query component of the URL.
| bool isValid | ( | ) | const throw () |
Test if the URL is valid.
| bool operator!= | ( | const URL & | other | ) | const throw () [inline] |
Inequality operator.
| bool operator== | ( | const URL & | other | ) | const throw () |
Equality operator.
| void setPort | ( | uint16_t | port | ) | throw () [inline] |
Set the port number for the URL.
A value of 0 indicates no port number.
| void setQuery | ( | const String & | query | ) | [inline] |
Set the query component of the URL.
| query | The query, in URL-encoded form. |
1.6.3