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 uriParseScheme

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

Result uriParseScheme(
    const char[] chars, 
    const char[] scheme, 
    const char[] next, 
    UriParseHints hints
);

Documentation

"Low level" Uri parsing functions

Parses the scheme of a URI.

Notes

Given the string "https://abc.com", the schemeparameter will be set to "https" and the nextparameter will be set to "//abc.com". The colon is dropped.

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

The hint UriParseHints.isAbsoluteis always set.

Params

Throws

UriError.schemeIsInvalidif the scheme does not start with an alpha character

UriError.schemeIsInvalidif the scheme is empty

UriError.schemeIsInvalidif the scheme contains an invalid character after the first

UriError.schemeIsInvalidif charsdoes not contain a ':' to terminate the scheme

Returns

A Resultindicating whether the parsing was successful or not.