Url

The Url class parses and stores a Uniform Resource Locator, as specified in RFC1738 and RFC1808. More...

Public Methods

Url( const QString absUrl );
Url( const char* absUrl );
Url( const Url* absUrl, const QString relUrl );
static voidencode( QString& str );
QStringfragment( );
QStringhostname( );
QStringmethod( );
QStringparameters( );
QStringpassword( );
QStringpath( );
intport( );
QStringquery( );
voidsetPath( QString path );
voidsetQuery( QString query );
QStringurl( );
QStringuser( );

Private Methods

voidparseUrl( QString url );

Private Data Members

QString_fragment;
QString_hostname;
QString_method;
QString_parameters;
QString_password;
QString_path;
int_port;
QString_query;
QString_user;

Detailed Documentation

The Url class parses and stores a Uniform Resource Locator, as specified in RFC1738 and RFC1808.

This class can take a partially or fully qualified URL as a string, and parse it into its component parts. It can also resolve a partially qualified URL to a fully qualified URL using a fully qualified "base" URL.

Public Methods Documentation

Url ( const QString absUrl );

Parse a fully qualified URL.

Url ( const Url* absUrl, const QString relUrl );

Parse a partially qualified URL, and then resolve it with the given absolute URL.

QString fragment ( );

Return the URL's fragment.

QString hostname ( );

Return the URL's hostname.

QString method ( );

Return the URL's method.

QString parameters ( );

Return the URL's parameters.

QString password ( );

Return the URL's password.

QString path ( );

Return the URL's path.

int port ( );

Return the URL's port.

QString query ( );

Return the URL's query.

void setPath ( QString path );

Set the URL's path.

void setQuery ( QString query );

Set the URL's query.

QString url ( );

Return the fully qualified URL as a string.

QString user ( );

Return the URL's user name.

Private Methods Documentation

void parseUrl ( QString url );

Parse a url given as a text string into its component parts, as per the algorithm given in RFC1808. This routine successfully parses all the test cases mentioned in RFC1808. This algorithm works for partially and fully qualified URLs.


Return to Index.
Automatically generated on Aug 11 23:32