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