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 | |
this () | |
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 | |
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 | |
ubyte | map [256] |
short[char[]] | genericSchemes |
const char[] | hexDigits = "0123456789abcdef" |
IOException | error |
const SchemePort[] | schemePorts |
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 73 of file Uri.d.
|
|
|
Initialize the Uri character maps and so on Reimplemented in MutableUri. Definition at line 81 of file Uri.d. References error, ExcAuthority, ExcPath, ExcQuery, ExcScheme, genericSchemes, IncGeneric, IncPath, IncQuery, IncScheme, IncUser, and schemePorts. |
|
Reimplemented in MutableUri. Definition at line 163 of file Uri.d. References parse(). |
|
Definition at line 177 of file Uri.d. References genericSchemes, and InvalidPort. Referenced by getValidPort(). |
|
Definition at line 192 of file Uri.d. References scheme. Referenced by HttpRequest::getRequestUri(), testFilePath(), and testServletEngine(). |
|
Definition at line 204 of file Uri.d. Referenced by HttpRequest::getExplicitUri(), HttpRequest::getHost(), testFilePath(), testHttpClient3(), and HttpClient::this(). |
|
Definition at line 216 of file Uri.d. Referenced by HttpRequest::getHost(), and testFilePath(). |
|
Definition at line 228 of file Uri.d. References getDefaultPort(), InvalidPort, and scheme. Referenced by HttpClient::this(). |
|
Definition at line 242 of file Uri.d. References userinfo. |
|
Definition at line 254 of file Uri.d. Referenced by HttpClient::open(), ServletProvider::service(), testFilePath(), and testServletEngine(). |
|
Definition at line 266 of file Uri.d. References query. Referenced by HttpRequest::getInputParameters(), and testServletEngine(). |
|
Definition at line 278 of file Uri.d. References fragment. |
|
Definition at line 289 of file Uri.d. References genericSchemes, and scheme. |
|
Definition at line 301 of file Uri.d. References IBuffer::append(), encode(), IncUser, InvalidPort, scheme, and userinfo. |
|
Reimplemented from IWritable. |
|
Definition at line 360 of file Uri.d. References memchr(). Referenced by AdminServlet::service(), and testFilePath(). |
|
Definition at line 373 of file Uri.d. Referenced by HttpRequest::getInputParameters(). |
|
Encode uri characters into an output buffer, such that reserved chars are converted into their hex version. Definition at line 412 of file Uri.d. References IBuffer::append(), and IBuffer::put(). Referenced by write(). |
|
This should not be exposed outside of this module! Reimplemented in MutableUri. |
|
Parsing is performed according to RFC 2396
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 470 of file Uri.d. Referenced by this(). |
|
Authority is the section after the scheme, but before the path, query or fragment; it typically represents a host.
|
|
Class attributes Definition at line 562 of file Uri.d. Referenced by getDefaultPort(), getValidPort(), and write(). |
|
|
|
|
|
|
|
Definition at line 565 of file Uri.d. Referenced by getQuery(). |
|
Definition at line 565 of file Uri.d. Referenced by getScheme(), getValidPort(), isGeneric(), and write(). |
|
Definition at line 565 of file Uri.d. Referenced by getUserInfo(), and write(). |
|
Definition at line 565 of file Uri.d. Referenced by getFragment(). |
|
|
|
|
|
Definition at line 576 of file Uri.d. Referenced by getDefaultPort(), isGeneric(), and this(). |
|
|
|
Definition at line 580 of file Uri.d. Referenced by this(). |
|
Initial value:
[
{"coffee", 80}
Definition at line 600 of file Uri.d. Referenced by this(). |