Uri.split

Parses uri_ref (which can be an absolute or relative URI) according to flags, and returns the pieces. Any component that doesn't appear in uri_ref will be returned as null (but note that all URIs always have a path component, though it may be the empty string).

If flags contains G_URI_FLAGS_ENCODED, then %-encoded characters in uri_ref will remain encoded in the output strings. (If not, then all such characters will be decoded.) Note that decoding will only work if the URI components are ASCII or UTF-8, so you will need to use G_URI_FLAGS_ENCODED if they are not.

Note that the G_URI_FLAGS_HAS_PASSWORD and G_URI_FLAGS_HAS_AUTH_PARAMS flags are ignored by glib.uri.Uri.split, since it always returns only the full userinfo; use glib.uri.Uri.splitWithUser if you want it split up.

class Uri
static
bool
split
(
string uriRef
,,
out string scheme
,
out string userinfo
,
out string host
,
out int port
,
out string path
,
out string query
,
out string fragment
)

Parameters

uriRef string

a string containing a relative or absolute URI

flags glib.types.UriFlags

flags for parsing uri_ref

scheme string

on return, contains the scheme (converted to lowercase), or null

userinfo string

on return, contains the userinfo, or null

host string

on return, contains the host, or null

port int

on return, contains the port, or -1

path string

on return, contains the path

query string

on return, contains the query, or null

fragment string

on return, contains the fragment, or null

Return Value

Type: bool

true if uri_ref parsed successfully, false on error.