UrlDecoder

UrlDecoder class

Memory friendly, suitable for stack-allocated 'scope' instances.

Constructors

this
this(cstring source_in)

Constructor

Members

Functions

copyDecoded
bool copyDecoded(cstring decoded, cstring original)

To be overridden as an option, called by opApply().

opApply
int opApply(int delegate(ref cstring chunk) dg)

Decodes this.source in an 'foreach' iteration over decoded chunks.

Static functions

decode
mstring decode(mstring str)

Decodes '%' encoded characters in str, replacing them in-place.

decodeCharacter
mstring decodeCharacter(mstring dst, cstring source, size_t pos)

Extracts a single character from the specified position in the passed string, which is expected to be the index of a character preceded by a '%'. source[pos .. $] is scanned to see if they represent an encoded character in either the RFC 2396 escape format (%XX) or the non-standard escape format (%uXXXX) or if they should represent a '%' (%%).

hex2
bool hex2(char hi, char lo, char c)

Creates a character c with the value specified by the 2-digit ASCII hexadecimal number whose digits are hi and lo. For example, if hi = 'E' or 'e' and lo = '9', c will be 0xE9.

hex4
mstring hex4(cstring hex, mstring utf8_buf)

Converts hex, which is expected to contain a 4-digit ASCII hexadecimal number, into its corresponding UTF-8 character sequence.

Variables

source
cstring source;

Source string, may be changed at any time except during decoding 'foreach' iteration.

Meta