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

sword::URI Class Reference

An URI "Universal Resource Identifier". More...


Public Methods

 URI ()
 Creates an empty URI.

 URI (const std::string &uri)
 Creates an URI from a string.

 URI (const URI &uri)
 Creates a copy from this URI.

URI & operator= (const URI &uri)
 Creates a copy from this URI.

URI & operator= (const std::string &uri)
 Creates an URI from a string.

URI & operator+= (const std::string &rhs)
 Navigates within an URI.

std::string toString () const
 Stringify the URI.

bool empty () const
 Checks whether the URI is empty.

const URISchemescheme () const
 Access the URI Scheme data.

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


Friends

URI operator+ (const URI &lhs, const std::string &rhs)
 Navigates within an URI.


Detailed Description

An URI "Universal Resource Identifier".

Holds all necessary data to locate a resource (file, data...) using many different networked or non-networked protocols. The syntax of a stringified URI follows RFC 1630 and RFC 1738.

The general syntax for creating URI is (using the URI constructor or the '=' operator):

You can also modify an existing URI (some also use the term 'navigate' in reference to web URLs) using the '+' or '+=' operators. The allowed URI syntaxes are then:

<absolute-path> or <relative-path> must end with a '/' in order to denote a directory. Otherwise, the last path part is considered to be a file name.

Examples of are the well known "http", "ftp", "file". It is also possible to use this URI for Win32 filesystem names such as "c:/MyFile.txt" for which the URI is "file://c:/MyFile.txt (the drive specification is then viewed as a "file" scheme option).

This class does not however support the Win32 '\' backslash path separator. Only forward slash '/' are accepted in order to maintain better portability across platforms.


Constructor & Destructor Documentation

sword::URI::URI  
 

Creates an empty URI.

sword::URI::URI const std::string &    uri
 

Creates an URI from a string.

sword::URI::URI const URI &    uri
 

Creates a copy from this URI.


Member Function Documentation

bool sword::URI::empty   const
 

Checks whether the URI is empty.

std::string sword::URI::filename   const
 

The file within the server (may be empty).

URI& sword::URI::operator+= const std::string &    rhs
 

Navigates within an URI.

URI& sword::URI::operator= const std::string &    uri
 

Creates an URI from a string.

URI& sword::URI::operator= const URI &    uri
 

Creates a copy from this URI.

std::string sword::URI::path   const
 

The path within the server (without the file).

const std::string& sword::URI::pathname   const
 

The full path name within the server.

const URIScheme& sword::URI::scheme   const
 

Access the URI Scheme data.

std::string sword::URI::toString   const
 

Stringify the URI.


Friends And Related Function Documentation

URI operator+ const URI &    lhs,
const std::string &    rhs
[friend]
 

Navigates within an URI.


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