Archon::Utilities::Uri Struct Reference

Encapsulation and syntactical check of a URI (Universal Resource Identifier). More...

#include <archon/util/uri.H>

Collaboration diagram for Archon::Utilities::Uri:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Uri ()
 Create a URI that refers to the current working directory.
 Uri (const string &uri, const Uri &baseUri=Uri())
 Construct a URI from a relative or absolute string representation.
 ~Uri ()
bool isFileScheme () const
string getScheme () const
 Will return something like 'http:', and ever the empty string.
string getAuthority () const
 Will typically return something like '//www.ietf.org' but may also return '//' or even the empty string.
string getPath () const
 Will typically return something like '/rfc/rfc2396.txt' but may also return the empty string.
string getQuery () const
 Will typically return something like '?foo=bar' but may also return '?' or even the empty string.
string getFile () const
string toString () const

Static Public Member Functions

static string encode (const string &s, bool plusForSpace)
 Encode a string according to the URI component encoding scheme.
static string decode (const string &s, bool plusForSpace)
 Decode a string according to the URI component encoding scheme.
static string explain (const SyntaxException &)
 Generate a detailed explanatory message about the specified error.

Classes

struct  SyntaxException

Detailed Description

Encapsulation and syntactical check of a URI (Universal Resource Identifier).

See also:
RFC 2396, URI Generic Syntax, August 1998 - http://www.ietf.org/rfc/rfc2396.txt

Definition at line 47 of file uri.H.


Constructor & Destructor Documentation

Archon::Utilities::Uri::Uri const string &  uri,
const Uri baseUri = Uri()
 

Construct a URI from a relative or absolute string representation.

If the URI is relative (or empty) it is resolved against the specified base URI.

Throws SyntaxException if the argument is malformed.

Todo:
Either SyntaxException must be declared to be thrown or another sollution must be sought.

Definition at line 607 of file uri.C.

References Archon::Utilities::Text::compareIgnoreCase(), Archon::SaiTestApps::Filebrowser::path, scheme, and Archon::Utilities::schemeName().


Member Function Documentation

string Archon::Utilities::Uri::decode const string &  s,
bool  plusForSpace
[static]
 

Decode a string according to the URI component encoding scheme.

Parameters:
s A URI encoded string. Should be restricted to the US_ASCII character encoding.
Returns:
The decoded string in UTF-8 character encoding.

Definition at line 741 of file uri.C.

Referenced by Archon::Raytracer::main().

string Archon::Utilities::Uri::encode const string &  s,
bool  plusForSpace
[static]
 

Encode a string according to the URI component encoding scheme.

Parameters:
s An arbitrary string in UTF-8 character encoding.
Returns:
A URI encoded version of the string. It will be restricted to US_ASCII character encoding.

Definition at line 719 of file uri.C.

References Archon::Utilities::charClassTable, and Archon::Utilities::unreservedMask.

Referenced by Uri().


The documentation for this struct was generated from the following files:
Generated on Sun Jul 30 22:58:02 2006 for Archon by  doxygen 1.4.4