|
VMime
|
#include <url.hpp>
Public Member Functions | |
| url (const string &s) | |
| url (const url &u) | |
| url (const string &protocol, const string &host, const port_t port=UNSPECIFIED_PORT, const string &path="", const string &username="", const string &password="") | |
| const string & | getProtocol () const |
| void | setProtocol (const string &protocol) |
| const string & | getUsername () const |
| void | setUsername (const string &username) |
| const string & | getPassword () const |
| void | setPassword (const string &password) |
| const string & | getHost () const |
| void | setHost (const string &host) |
| port_t | getPort () const |
| void | setPort (const port_t port) |
| const string & | getPath () const |
| void | setPath (const string &path) |
| const std::map< string, string > & | getParams () const |
| std::map< string, string > & | getParams () |
| operator string () const | |
| url & | operator= (const url &u) |
| url & | operator= (const string &s) |
Static Public Attributes | |
| static const port_t | UNSPECIFIED_PORT = static_cast <port_t>(-1) |
| static const string | PROTOCOL_FILE = "file" |
| static const string | PROTOCOL_HTTP = "http" |
| static const string | PROTOCOL_FTP = "ftp" |
This class represents a Uniform Resource Locator (a pointer to a "resource" on the World Wide Web).
Construct an URL from a string (parse the URL components).
| s | full URL string (eg. http://www.vmime.org:80/download.html) |
| exceptions::malformed_url | if URL is malformed |
References vmime::dynamicCast().
Construct an URL from another URL object.
| u | other URL object |
References vmime::dynamicCast(), and url::operator=().
| url | ( | const string & | protocol, |
| const string & | host, | ||
| const port_t | port = UNSPECIFIED_PORT, |
||
| const string & | path = "", |
||
| const string & | username = "", |
||
| const string & | password = "" |
||
| ) |
Construct an URL from the components.
| protocol | protocol (eg. "http", "ftp"...) |
| host | host name (eg. "www.vmime.org", "123.45.67.89") |
| port | optional port number (eg. 80, 110 or UNSPECIFIED_PORT to mean "default") |
| path | optional full path (eg. "download.html") |
| username | optional user name |
| password | optional user password |
Return the host name of the URL (server name or IP address).
Return the parameters of the URL (read-only).
Return the password specified in the URL or empty if not specified.
Return the path portion of the URL, or empty if not specified.
| port_t getPort | ( | ) | const |
Return the port of the URL, or url::UNSPECIFIED_PORT if the default port if used.
Return the protocol of the URL (eg: "http").
Return the username specified in the URL or empty if not specified.
References vmime::dynamicCast().
References vmime::dynamicCast().
Referenced by url::url().
Set the host name of the URL.
| host | server name or IP address |
References vmime::dynamicCast().
Set the port of the URL.
| port | server port or url::UNSPECIFIED_PORT to use the default port of the protocol |
References vmime::dynamicCast().
Set the protocol of the URL.
| protocol | new protocol (eg: "http") |
References vmime::dynamicCast().
|
static |
Means "port not specified" (use default port).
Referenced by serviceFactory::create().