Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions uriParseFragment

1
2
3
4
5
6
7
8
module juptune.http.uri;

Result uriParseFragment(
    const char[] chars, 
    const char[] fragment, 
    const char[] next, 
    UriParseHints hints
);

Documentation

Parses the fragment of a URI.

Valid Formats

fragmentIsEmpty ->

percentEncodedFragment -> #frag%20ment, e.g. "#some%20fragment"

!fragmentIsEmpty -> #fragment, e.g. "#some-fragment"

Notes

Given the string "#some-fragment", the fragmentparameter will be set to "some-fragment", and the nextparameter will be set to the empty string.

The output of all outparameters is undefined if the function returns an error.

While percent encoding is validated, it is not decoded.

Params

Throws

UriError.fragmentIsInvalidif the fragment contains an invalid character

UriError.fragmentIsInvalidif the fragment contains an invalid percent encoded character

UriError.fragmentIsInvalidif the first character is not '#'

Returns

A Resultindicating whether the parsing was successful or not.