VMime
|
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 |
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 |
const string & getHost | ( | ) | const |
Return the host name of the URL (server name or IP address).
Referenced by serviceFactory::create().
Return the parameters of the URL (read-only).
const string & getPassword | ( | ) | const |
Return the password specified in the URL or empty if not specified.
Referenced by serviceFactory::create().
const string & getPath | ( | ) | const |
Return the path portion of the URL, or empty if not specified.
Referenced by serviceFactory::create().
port_t getPort | ( | ) | const |
Return the port of the URL, or url::UNSPECIFIED_PORT if the default port if used.
Referenced by serviceFactory::create().
const string & getProtocol | ( | ) | const |
Return the protocol of the URL (eg: "http").
Referenced by serviceFactory::create().
const string & getUsername | ( | ) | const |
Return the username specified in the URL or empty if not specified.
Referenced by serviceFactory::create().
operator string | ( | ) | const |
Build a string URL from this object.
Referenced by url::url().
void setHost | ( | const string & | host | ) |
Set the host name of the URL.
host | server name or IP address |
void setPassword | ( | const string & | password | ) |
Set the password of the URL.
password | user password |
void setPath | ( | const string & | path | ) |
Set the part portion of the URL.
path | path |
void setPort | ( | const port_t | port | ) |
Set the port of the URL.
port | server port or url::UNSPECIFIED_PORT to use the default port of the protocol |
void setProtocol | ( | const string & | protocol | ) |
Set the protocol of the URL.
protocol | new protocol (eg: "http") |
void setUsername | ( | const string & | username | ) |
Set the username of the URL.
username | user name |
|
static |
Standard name for FILE protocol (local file-system).
|
static |
Standard name for FTP protocol.
|
static |
Standard name for HTTP protocol.
Means "port not specified" (use default port).
Referenced by serviceFactory::create().