std.uri

Encode and decode Uniform Resource Identifiers (URIs). URIs are used in internet transfer protocols. Valid URI characters consist of letters, digits, and the characters ;/?:@&=+$,-_.!~*'() Reserved URI characters are ;/?:@&=+$, Escape sequences consist of % followed by two hex digits.

See Also

Types 1

classURIException : Exception

This Exception is thrown if something goes wrong when encoding or decoding a URI.

Functions 10

private fnstring URI_Encode(dstring str, uint unescapedSet) @safe pure
private fnuint ascii2hex(dchar c) @nogc @safe pure nothrow
private fndstring URI_Decode(Char)(scope const(Char)[] uri, uint reservedSet) if (isSomeChar!Char)
fnstring decode(Char)(scope const(Char)[] encodedURI) if (isSomeChar!Char)Decodes the URI string encodedURI into a UTF-8 string and returns it. Escape sequences that resolve to reserved URI characters are not replaced. Escape sequences that resolve to the '#' character a...
fnstring decodeComponent(Char)(scope const(Char)[] encodedURIComponent) if (isSomeChar!Char)Decodes the URI string encodedURI into a UTF-8 string and returns it. All escape sequences are decoded.
fnstring encode(Char)(scope const(Char)[] uri) if (isSomeChar!Char)Encodes the UTF-8 string uri into a URI and returns that URI. Any character not a valid URI character is escaped. The '#' character is not escaped.
fnstring encodeComponent(Char)(scope const(Char)[] uriComponent) if (isSomeChar!Char)Encodes the UTF-8 string uriComponent into a URI and returns that URI. Any character not a letter, digit, or one of -_.!~*'() is escaped.
fnstring urlEncode(scope string[string] values) @safe pure
fnptrdiff_t uriLength(Char)(scope const(Char)[] s) if (isSomeChar!Char)Does string s[] start with a URL? Returns: -1 it does not len it does, and s[0 .. len] is the slice of s[] that is that URL
fnptrdiff_t emailLength(Char)(scope const(Char)[] s) if (isSomeChar!Char)Does string s[] start with an email address? Returns: -1 it does not len it does, and s[0 .. i] is the slice of s[] that is that email address References: RFC2822

Variables 2

private varchar[16] hex2ascii
private varubyte[128] uri_flags