Uri class and parser

Adam D. Ruppe destructionator at gmail.com
Wed Oct 24 05:47:13 PDT 2012


On Wednesday, 24 October 2012 at 07:38:58 UTC, Jacob Carlborg 
wrote:
> It would be nice if there were methods for getting/setting the 
> path component as an array. Also methods for getting/setting 
> the query component as an associative array.

BTW don't forget that this is legal:

?value&value=1&value=2

The appropriate type for the AA is

string[][string]


This is why my cgi.d has functions two decodeVariables and 
decodeVariablesSingle and two members (in the Cgi class, I didn't 
add it to the Uri struct) get and getArray.

decodeVariables returns the complete string[][string]

and the single versions only keep the last element of the 
string[], which gives a string[string] for convenience.


More information about the Digitalmars-d mailing list