Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

sword::URL Class Reference

An Internetl URL (http://..., ftp://...). More...


Public Types

enum  Scheme { http, ftp, nntp, invalid }

Public Methods

 URL ()
 Creates an empty URL.

 URL (const std::string &url)
 Creates an URL instance from a stringified absolute URL.

 URL (const URL &url)
 Creates a copy from this url.

URL & operator= (const URL &url)
 Creates a copy from this url.

void parse (const std::string &url, bool needAbsolute=false)
 Creates an URL instance from a stringified URL.

void navigate (const std::string &move)
 Navigate within this URL.

std::string toString () const
bool empty () const
 Checks whether the URL is empty.

const std::string & server () const
 The URL server host name.

const int port () const
 The URL server TCP port.

const std::string & pathname () const
 The full path name within the server.

std::string path () const
 The path within the server (without the file).

std::string filename () const
 The file within the server (may be empty).

Scheme scheme () const
 The scheme that must be used to connect.

bool hasCredentials () const
 Has this URL a credential specification ?

const std::string & login () const
 The login required to access this resource.

const std::string & password () const
 The password required to access this resource.


Detailed Description

An Internetl URL (http://..., ftp://...).

Holds both the reference to an internet server, the scheme to use when connecting and the path within the server. The URL syntax is described in RFC 1738 (http://www.w3.org/Addressing/rfc1738.txt).

This class recognised both absolute URLs ://:<host>:/<url-path> , and are optional.

And the relative URLs :<relative-url-path>


Constructor & Destructor Documentation

sword::URL::URL  
 

Creates an empty URL.

sword::URL::URL const std::string &    url
 

Creates an URL instance from a stringified absolute URL.

sword::URL::URL const URL &    url
 

Creates a copy from this url.


Member Function Documentation

bool sword::URL::empty   const
 

Checks whether the URL is empty.

std::string sword::URL::filename   const
 

The file within the server (may be empty).

bool sword::URL::hasCredentials   const
 

Has this URL a credential specification ?

const std::string& sword::URL::login   const
 

The login required to access this resource.

This is valid only if URL::hasCredential is true

void sword::URL::navigate const std::string &    move
 

Navigate within this URL.

The provided 'move' is a relative path to be applied to the current URL data. It must not contain any scheme or server specification.

URL& sword::URL::operator= const URL &    url
 

Creates a copy from this url.

void sword::URL::parse const std::string &    url,
bool    needAbsolute = false
 

Creates an URL instance from a stringified URL.

An absolute stringified URL will fully override the existing URL data. A relative stringified URL will 'navigate' within the existing location

const std::string& sword::URL::password   const
 

The password required to access this resource.

This is valid only if URL::hasCredential is true

std::string sword::URL::path   const
 

The path within the server (without the file).

const std::string& sword::URL::pathname   const
 

The full path name within the server.

const int sword::URL::port   const
 

The URL server TCP port.

Scheme sword::URL::scheme   const
 

The scheme that must be used to connect.

const std::string& sword::URL::server   const
 

The URL server host name.


Generated on Tue Dec 23 20:08:57 2003 for SWORD by doxygen1.3-rc2