Inheritance diagram for Uri:
Public Member Functions | |
this (char[] uri) | |
char[] | getScheme () |
char[] | getHost () |
int | getPort () |
int | getValidPort () |
char[] | getUserInfo () |
char[] | getPath () |
char[] | getQuery () |
char[] | getFragment () |
bool | isGeneric () |
IBuffer | write (IBuffer buf) |
void | write (IWriter writer) |
override char[] | toString () |
char[] | decode (char[] s) |
Static Public Member Functions | |
static | this () |
static final int | getDefaultPort (char[] scheme) |
Private Types | |
enum | { ExcScheme = 0x01, ExcAuthority = 0x02, ExcPath = 0x04, ExcQuery = 0x08, IncUser = 0x10, IncPath = 0x20, IncQuery = 0x40, IncScheme = 0x80, IncGeneric = IncScheme | IncUser | IncPath | IncQuery } |
Private Member Functions | |
this () | |
void | parse (char[] uri) |
void | parseAuthority (char[] auth) |
Static Private Member Functions | |
static IBuffer | encode (IBuffer buf, char[] s, int flags) |
Private Attributes | |
const int | InvalidPort = -1 |
int | port |
char[] | host |
char[] | path |
char[] | query |
char[] | scheme |
char[] | userinfo |
char[] | fragment |
HeapSlice | decoded |
Static Private Attributes | |
static ubyte | map [256] |
static short[char[]] | genericSchemes |
static const char[] | hexDigits = "0123456789abcdef" |
static IOException | error |
static const SchemePort[] | schemePorts |
Classes | |
struct | SchemePort |
The implementation fails the spec on two counts: it doesn't insist on a scheme being present in the Uri, and it doesn't implement the "Relative References" support noted in section 5.2. Note that IRI support can be added by assuming each of userinfo, path, query, and fragment are UTF-8 encoded (see this page for further details).
Use the MutableUri derivative where you need to alter specific uri attributes.
Definition at line 76 of file Uri.d.
|
|
|
Initialize the Uri character maps and so on Reimplemented in MutableUri. Definition at line 84 of file Uri.d. References error, ExcAuthority, ExcPath, ExcQuery, ExcScheme, genericSchemes, IncGeneric, IncPath, IncQuery, IncScheme, IncUser, map, and schemePorts. |
|
Reimplemented in MutableUri. Definition at line 166 of file Uri.d. References parse(). |
|
Definition at line 180 of file Uri.d. References genericSchemes, InvalidPort, and port. Referenced by getValidPort(), and write(). |
|
Definition at line 195 of file Uri.d. References scheme. Referenced by HttpRequest::getRequestUri(), testFilePath(), and testServletEngine(). |
|
Definition at line 207 of file Uri.d. References host. Referenced by HttpRequest::getExplicitUri(), HttpRequest::getHost(), testFilePath(), testHttpClient3(), and HttpClient::this(). |
|
Definition at line 219 of file Uri.d. References port. Referenced by HttpRequest::getHost(), and testFilePath(). |
|
Definition at line 231 of file Uri.d. References getDefaultPort(), InvalidPort, port, and scheme. Referenced by HttpClient::this(). |
|
Definition at line 245 of file Uri.d. References userinfo. |
|
Definition at line 257 of file Uri.d. References path. Referenced by HttpClient::open(), ServletProvider::service(), testFilePath(), and testServletEngine(). |
|
Definition at line 269 of file Uri.d. References query. Referenced by HttpRequest::getInputParameters(), and testServletEngine(). |
|
Definition at line 281 of file Uri.d. References fragment. |
|
Definition at line 292 of file Uri.d. References genericSchemes, and scheme. |
|
Definition at line 304 of file Uri.d. References IBuffer::append(), encode(), fragment, getDefaultPort(), host, IncPath, IncQuery, IncUser, InvalidPort, path, port, query, scheme, and userinfo. Referenced by toString(), and write(). |
|
Reimplemented from IWritable. Definition at line 352 of file Uri.d. References IWriter::getBuffer(), and write(). |
|
Definition at line 363 of file Uri.d. References IBuffer::toString(), and write(). Referenced by AdminServlet::service(), FilePath::splice(), and testFilePath(). |
|
Definition at line 376 of file Uri.d. References decoded, HeapSlice::expand(), memchr(), and HeapSlice::slice(). Referenced by HttpRequest::getInputParameters(), parse(), and parseAuthority(). |
|
Encode uri characters into an output buffer, such that reserved chars are converted into their hex version. Definition at line 416 of file Uri.d. References IBuffer::append(), hexDigits, and map. Referenced by write(). |
|
This should not be exposed outside of this module! Reimplemented in MutableUri. Definition at line 448 of file Uri.d. References decoded, HeapSlice, InvalidPort, and port. |
|
Parsing is performed according to RFC 2396
^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? 12 3 4 5 6 7 8 9 2 isolates scheme 4 isolates authority 5 isolates path 7 isolates query 9 isolates fragment This was originally a state-machine; it turned out to be a lot faster (~40%) when unwound like this instead. Reimplemented in MutableUri. Definition at line 474 of file Uri.d. References decode(), ExcAuthority, ExcPath, ExcScheme, fragment, map, parseAuthority(), path, query, and scheme. Referenced by HttpRequest::getHost(), and this(). |
|
Authority is the section after the scheme, but before the path, query or fragment; it typically represents a host.
Definition at line 532 of file Uri.d. References decode(), host, port, and userinfo. Referenced by parse(). |
|
Class attributes Definition at line 566 of file Uri.d. Referenced by getDefaultPort(), HttpRequest::getHost(), getValidPort(), this(), and write(). |
|
Definition at line 568 of file Uri.d. Referenced by getDefaultPort(), getPort(), getValidPort(), parseAuthority(), this(), and write(). |
|
Definition at line 569 of file Uri.d. Referenced by getHost(), parseAuthority(), and write(). |
|
|
|
Definition at line 569 of file Uri.d. Referenced by getQuery(), parse(), and write(). |
|
Definition at line 569 of file Uri.d. Referenced by getScheme(), getValidPort(), isGeneric(), parse(), and write(). |
|
Definition at line 569 of file Uri.d. Referenced by getUserInfo(), parseAuthority(), and write(). |
|
Definition at line 569 of file Uri.d. Referenced by getFragment(), parse(), and write(). |
|
|
|
|
|
Definition at line 580 of file Uri.d. Referenced by getDefaultPort(), isGeneric(), and this(). |
|
Definition at line 582 of file Uri.d. Referenced by encode(). |
|
Definition at line 584 of file Uri.d. Referenced by this(). |
|
Initial value:
[
{"coffee", 80}
Definition at line 604 of file Uri.d. Referenced by this(). |