VMime
url Class Reference

List of all members.

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 stringgetProtocol () const
void setProtocol (const string &protocol)
const stringgetUsername () const
void setUsername (const string &username)
const stringgetPassword () const
void setPassword (const string &password)
const stringgetHost () const
void setHost (const string &host)
port_t getPort () const
void setPort (const port_t port)
const stringgetPath () const
void setPath (const string &path)
const propertySetgetParams () const
propertySetgetParams ()
 operator string () const
urloperator= (const url &u)
urloperator= (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"

Detailed Description

This class represents a Uniform Resource Locator (a pointer to a "resource" on the World Wide Web).


Constructor & Destructor Documentation

url ( const string s)

Construct an URL from a string (parse the URL components).

Parameters:
sfull URL string (eg. http://www.vmime.org:80/download.html)
Exceptions:
exceptions::malformed_urlif URL is malformed
url ( const url u)

Construct an URL from another URL object.

Parameters:
uother URL object

References 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.

Parameters:
protocolprotocol (eg. "http", "ftp"...)
hosthost name (eg. "www.vmime.org", "123.45.67.89")
portoptional port number (eg. 80, 110 or UNSPECIFIED_PORT to mean "default")
pathoptional full path (eg. "download.html")
usernameoptional user name
passwordoptional user password

Member Function Documentation

const string & getHost ( ) const

Return the host name of the URL (server name or IP address).

Returns:
host name

Referenced by serviceFactory::create().

const propertySet & getParams ( ) const

Return the parameters of the URL (read-only).

Returns:
parameters
propertySet & getParams ( )

Return the parameters of the URL.

Returns:
parameters
const string & getPassword ( ) const

Return the password specified in the URL or empty if not specified.

Returns:
user password

Referenced by serviceFactory::create().

const string & getPath ( ) const

Return the path portion of the URL, or empty if not specified.

Returns:
path

Referenced by serviceFactory::create().

port_t getPort ( ) const

Return the port of the URL, or url::UNSPECIFIED_PORT if the default port if used.

Returns:
server port

Referenced by serviceFactory::create().

const string & getProtocol ( ) const

Return the protocol of the URL (eg: "http").

Returns:
protocol of the URL

Referenced by serviceFactory::create().

const string & getUsername ( ) const

Return the username specified in the URL or empty if not specified.

Returns:
user name

Referenced by serviceFactory::create().

operator string ( ) const

Build a string URL from this object.

url & operator= ( const url u)

Referenced by url::url().

url & operator= ( const string s)
void setHost ( const string host)

Set the host name of the URL.

Parameters:
hostserver name or IP address
void setPassword ( const string password)

Set the password of the URL.

Parameters:
passworduser password
void setPath ( const string path)

Set the part portion of the URL.

Parameters:
pathpath
void setPort ( const port_t  port)

Set the port of the URL.

Parameters:
portserver port or url::UNSPECIFIED_PORT to use the default port of the protocol
void setProtocol ( const string protocol)

Set the protocol of the URL.

Parameters:
protocolnew protocol (eg: "http")
void setUsername ( const string username)

Set the username of the URL.

Parameters:
usernameuser name

Member Data Documentation

const string PROTOCOL_FILE = "file"
static

Standard name for FILE protocol (local file-system).

const string PROTOCOL_FTP = "ftp"
static

Standard name for FTP protocol.

const string PROTOCOL_HTTP = "http"
static

Standard name for HTTP protocol.

const port_t UNSPECIFIED_PORT = static_cast <port_t>(-1)
static

Means "port not specified" (use default port).

Referenced by serviceFactory::create().


The documentation for this class was generated from the following files: