- alias port getPort [public] ¶#
-
old method names
- static this() ¶#
-
Initialize the Uri character maps and so on
- this() ¶#
-
Create an empty Uri
- this(char[] uri) ¶#
-
Construct a Uri from the provided character string
- this(char[] scheme, char[] host, char[] path, char[] query = null) ¶#
-
Construct a Uri from the given components. The query is
optional.
- this(UriView other) ¶#
-
Clone another Uri. This can be used to make a mutable Uri
from an immutable UriView.
- int defaultPort(char[] scheme) [final] ¶#
-
Return the default port for the given scheme. InvalidPort
is returned if the scheme is unknown, or does not accept
a port.
- char[] scheme() [final] ¶#
-
Return the parsed scheme, or null if the scheme was not
specified
- char[] host() [final] ¶#
-
Return the parsed host, or null if the host was not
specified
- int port() [final] ¶#
-
Return the parsed port number, or InvalidPort if the port
was not provided.
- int validPort() [final] ¶#
-
Return a valid port number by performing a lookup on the
known schemes if the port was not explicitly specified.
- char[] userinfo() [final] ¶#
-
Return the parsed userinfo, or null if userinfo was not
provided.
- char[] path() [final] ¶#
-
Return the parsed path, or null if the path was not
provided.
- char[] query() [final] ¶#
-
Return the parsed query, or null if a query was not
provided.
- char[] fragment() [final] ¶#
-
Return the parsed fragment, or null if a fragment was not
provided.
- bool isGeneric() [final] ¶#
-
Return whether or not the Uri scheme is considered generic.
- size_t produce(Consumer consume) [final] ¶#
-
Emit the content of this Uri via the provided Consumer. The
output is constructed per RFC 2396.
- char[] toString() [final] ¶#
-
Emit the content of this Uri via the provided Consumer. The
output is constructed per RFC 2396.
- size_t encode(Consumer consume, char[] s, int flags) [static] ¶#
-
Encode uri characters into a Consumer, such that
reserved chars are converted into their %hex version.
- char[] encode(char[] text, int flags) [static] ¶#
-
Encode uri characters into a string, such that reserved
chars are converted into their %hex version.
Returns a dup'd string
- char[] decoder(char[] s, char ignore = 0) [private] ¶#
-
Decode a character string with potential %hex values in it.
The decoded strings are placed into a thread-safe expanding
buffer, and a slice of it is returned to the caller.
- char[] decode(char[] s) [final] ¶#
-
Decode a duplicated string with potential %hex values in it
- Uri parse(char[] uri, bool relative = false) [final] ¶#
-
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.
- void reset() [final] ¶#
-
Clear everything to null.
- Uri relParse(char[] uri) [final] ¶#
-
Parse the given uri, with support for relative URLs
- Uri scheme(char[] scheme) [final] ¶#
-
Set the Uri scheme
- Uri host(char[] host) [final] ¶#
-
Set the Uri host
- Uri port(int port) [final] ¶#
-
Set the Uri port
- Uri userinfo(char[] userinfo) [final] ¶#
-
Set the Uri userinfo
- Uri query(char[] query) [final] ¶#
-
Set the Uri query
- char[] extendQuery(char[] tail) [final] ¶#
-
Extend the Uri query
- Uri path(char[] path) [final] ¶#
-
Set the Uri path
- Uri fragment(char[] fragment) [final] ¶#
-
Set the Uri fragment
- void parseAuthority(char[] auth) [private] ¶#
-
Authority is the section after the scheme, but before the
path, query or fragment; it typically represents a host.
1
2
3
4
5
6
| ^(([^@]*)@?)([^:]*)?(:(.*))?
12 3 4 5
2 isolates userinfo
3 isolates host
5 isolates port
|
- char[] toLastSlash(char[] path) [private, final] ¶#
-
- char[] toLower(ref char[] src) [private, static, final] ¶#
-
in-place conversion to lowercase